From 9dae6337e9c287321546eb3c31e34248d6592df2 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Fri, 26 Oct 2012 12:38:36 +0200 Subject: [PATCH 01/84] fix test case broken by revision 247 (changed paths) Signed-off-by: Tiago Rossi --- .../production/XadesSignatureFormatExtenderImplTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/xades4j/production/XadesSignatureFormatExtenderImplTest.java b/src/test/java/xades4j/production/XadesSignatureFormatExtenderImplTest.java index 8d3b8cd3..77f5cd40 100644 --- a/src/test/java/xades4j/production/XadesSignatureFormatExtenderImplTest.java +++ b/src/test/java/xades4j/production/XadesSignatureFormatExtenderImplTest.java @@ -57,7 +57,7 @@ public void testEnrichSignatureWithA() throws Exception { System.out.println("enrichSignatureWithA"); - Document doc = getDocument("document.verified.c.xl.xml"); + Document doc = getDocument("out/document.verified.c.xl.xml"); Element signatureNode = (Element)doc.getElementsByTagNameNS(Constants.SignatureSpecNS, "Signature").item(0); XadesSignatureFormatExtenderImpl instance = (XadesSignatureFormatExtenderImpl)new XadesFormatExtenderProfile().getFormatExtender(); From dc1a599c8d7468d0793bbf41dbb56b32b5ff4544 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Fri, 12 Oct 2012 14:58:07 +0200 Subject: [PATCH 02/84] basic support for XAdES-X signature verification Signed-off-by: Tiago Rossi --- .../DefaultVerificationBindingsModule.java | 2 + .../QualifPropsDataCollectorImpl.java | 7 + .../SigAndRefsTimeStampVerifier.java | 130 ++++++++++++++++++ .../verification/XAdESFormChecker.java | 2 +- .../FromXmlSigAndRefsTimeStampConverter.java | 56 ++++++++ .../FromXmlUnsupportedUSPLimiter.java | 1 - .../QualifyingPropertiesDataCollector.java | 5 +- .../unmarshalling/UnsignedSigPropsModule.java | 1 + 8 files changed, 201 insertions(+), 3 deletions(-) create mode 100644 src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java create mode 100644 src/main/java/xades4j/xml/unmarshalling/FromXmlSigAndRefsTimeStampConverter.java diff --git a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java index 97ca8403..446e2e74 100644 --- a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java +++ b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java @@ -36,6 +36,7 @@ import xades4j.properties.data.GenericDOMData; import xades4j.properties.data.IndividualDataObjsTimeStampData; import xades4j.properties.data.PropertyDataObject; +import xades4j.properties.data.SigAndRefsTimeStampData; import xades4j.properties.data.SignaturePolicyData; import xades4j.properties.data.SignatureProdPlaceData; import xades4j.properties.data.SignatureTimeStampData; @@ -115,6 +116,7 @@ public InputStream getSignaturePolicyDocumentStream( bindBuiltInVerifier(SignatureTimeStampData.class, SignatureTimeStampVerifier.class); bindBuiltInVerifier(CompleteCertificateRefsData.class, CompleteCertRefsVerifier.class); bindBuiltInVerifier(CompleteRevocationRefsData.class, CompleteRevocRefsVerifier.class); + bindBuiltInVerifier(SigAndRefsTimeStampData.class, SigAndRefsTimeStampVerifier.class); MapBinder unkownElemsBinder = MapBinder.newMapBinder(binder(), QName.class, QualifyingPropertyVerifier.class); unkownElemsBinder diff --git a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java index 2388450e..5e560622 100644 --- a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java @@ -23,6 +23,7 @@ import xades4j.properties.data.GenericDOMData; import xades4j.properties.data.IndividualDataObjsTimeStampData; import xades4j.properties.data.OtherPropertyData; +import xades4j.properties.data.SigAndRefsTimeStampData; import xades4j.properties.data.SignaturePolicyData; import xades4j.properties.data.SignatureTimeStampData; import xades4j.properties.data.SignerRoleData; @@ -99,6 +100,12 @@ public void addSignatureTimeStamp(SignatureTimeStampData sigTSData) } @Override + public void addSigAndRefsTimeStamp(SigAndRefsTimeStampData tsData) + { + propsData.add(tsData); + } + + @Override public void addCommitmentType(CommitmentTypeData commitmentData) { propsData.add(commitmentData); diff --git a/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java b/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java new file mode 100644 index 00000000..86dc11b8 --- /dev/null +++ b/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java @@ -0,0 +1,130 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import org.apache.xml.security.utils.Constants; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import com.google.inject.Inject; + +import xades4j.properties.CompleteCertificateRefsProperty; +import xades4j.properties.CompleteRevocationRefsProperty; +import xades4j.properties.QualifyingProperty; +import xades4j.properties.SigAndRefsTimeStampProperty; +import xades4j.properties.SignatureTimeStampProperty; +import xades4j.properties.data.SigAndRefsTimeStampData; +import xades4j.providers.TimeStampVerificationProvider; +import xades4j.utils.CannotAddDataToDigestInputException; +import xades4j.utils.DOMHelper; +import xades4j.utils.TimeStampDigestInput; +import xades4j.utils.TimeStampDigestInputFactory; + +/** + * Verifier for the XAdES-X time stamp property - SigAndRefsTimeStamp + * XAdES v1.4.2 G.2.2.16.2.3 + * + * @author Hubert Kario + */ +public class SigAndRefsTimeStampVerifier extends + TimeStampVerifierBase +{ + @Inject + public SigAndRefsTimeStampVerifier( + TimeStampVerificationProvider timeStampVerifier, + TimeStampDigestInputFactory timeStampDigestInputFactory) + { + super(timeStampVerifier, timeStampDigestInputFactory, + SigAndRefsTimeStampProperty.PROP_NAME); + } + + @Override + protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + SigAndRefsTimeStampData propData, TimeStampDigestInput digestInput, + QualifyingPropertyVerificationContext ctx) + throws CannotAddDataToDigestInputException, + TimeStampVerificationException + { + /* + * "Take each one of the signed properties and not property elements in the + * signature that the normative part dictates that must be time-stamped, in the + * order specified in the normative clause defining the time-stamp token + * container type. Canonicalize them and concatenate the resulting bytes in one + * octet stream. If the CanonicalizationMethod element of the property is + * present, use it for canonicalizing. Otherwise, use the standard + * canonicalization method as specified by XMLDSIG." + */ + + // TimeStamp is taken over SignatureValue element + Element sigValueElem = DOMHelper.getFirstDescendant( + ctx.getSignature().getElement(), + Constants.SignatureSpecNS, + Constants._TAG_SIGNATUREVALUE); + digestInput.addNode(sigValueElem); + + // next elements that should have been timestamped are all SignatureTimeStamps + // there may be no SignatureTimeStamps + // TODO write test for document with SigAndRefsTimeStamp but no SignatureTimeStamp + NodeList signatureTimeStamps = ctx.getSignature().getElement().getElementsByTagNameNS( + SignatureTimeStampProperty.XADES_XMLNS, + SignatureTimeStampProperty.PROP_NAME); + for (int i=0; i < signatureTimeStamps.getLength(); i++) + { + Element timeStampElem = (Element) signatureTimeStamps.item(i); + digestInput.addNode(timeStampElem); + } + + // then CompleteCertificateRefs + Element completeCertificateRefsElem = DOMHelper.getFirstDescendant( + ctx.getSignature().getElement(), + CompleteCertificateRefsProperty.XADES_XMLNS, + CompleteCertificateRefsProperty.PROP_NAME); + digestInput.addNode(completeCertificateRefsElem); + + // ...and CompleteRevocationRefs + Element completeRevocationRefsElem = DOMHelper.getFirstDescendant( + ctx.getSignature().getElement(), + CompleteRevocationRefsProperty.XADES_XMLNS, + CompleteRevocationRefsProperty.PROP_NAME); + digestInput.addNode(completeRevocationRefsElem); + + // AttributeCertificateRefs are optional + // TODO implement missing classes + Element attributeCertificateRefs = DOMHelper.getFirstDescendant( + ctx.getSignature().getElement(), + CompleteRevocationRefsProperty.XADES_XMLNS, + "AttributeCertificateRefs"); + if (attributeCertificateRefs != null) + throw new CannotAddDataToDigestInputException( + new Exception("Can't verify SigAndRefsTimeStamp: " + + "AttributeCertificateRefs is unsupported")); + + // AttributeRevocationRefs are optional + // TODO implement missing classes + Element attributeRevocationRefs = DOMHelper.getFirstDescendant( + ctx.getSignature().getElement(), + CompleteRevocationRefsProperty.XADES_XMLNS, + "AttributeRevocationRefs"); + if (attributeRevocationRefs != null) + throw new CannotAddDataToDigestInputException( + new Exception("Can't verify SigAndRefsTimeStamp: " + + "AttributeRevocationRefs is unsupported")); + + return new SigAndRefsTimeStampProperty(); + } + +} diff --git a/src/main/java/xades4j/verification/XAdESFormChecker.java b/src/main/java/xades4j/verification/XAdESFormChecker.java index 0e7f462d..e3dabcb7 100644 --- a/src/main/java/xades4j/verification/XAdESFormChecker.java +++ b/src/main/java/xades4j/verification/XAdESFormChecker.java @@ -47,7 +47,7 @@ static XAdESForm checkForm(Collection props) throws InvalidXAdESFo availablePropsNames.add(propInfo.getProperty().getName()); } - XAdESFormDesc formDesc = XADES_C_DESC; + XAdESFormDesc formDesc = XADES_X_L_DESC; do { if (formDesc.check(availablePropsNames)) diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlSigAndRefsTimeStampConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlSigAndRefsTimeStampConverter.java new file mode 100644 index 00000000..bc71bd8f --- /dev/null +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlSigAndRefsTimeStampConverter.java @@ -0,0 +1,56 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.unmarshalling; + +import xades4j.algorithms.Algorithm; +import xades4j.properties.SigAndRefsTimeStampProperty; +import xades4j.properties.data.SigAndRefsTimeStampData; +import xades4j.xml.bind.xades.XmlUnsignedSignaturePropertiesType; + +public class FromXmlSigAndRefsTimeStampConverter + extends FromXmlBaseTimeStampConverter + implements UnsignedSigPropFromXmlConv +{ + + public FromXmlSigAndRefsTimeStampConverter() + { + super(SigAndRefsTimeStampProperty.PROP_NAME); + } + + @Override + public void convertFromObjectTree( + XmlUnsignedSignaturePropertiesType xmlProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { + super.convertTimeStamps(xmlProps.getSigAndRefsTimeStamp(), + propertyDataCollector); + } + + @Override + protected SigAndRefsTimeStampData createTSData(Algorithm c14n) + { + return new SigAndRefsTimeStampData(c14n); + } + + @Override + protected void setTSData(SigAndRefsTimeStampData tsData, + QualifyingPropertiesDataCollector propertyDataCollector) + { + propertyDataCollector.addSigAndRefsTimeStamp(tsData); + } +} diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java index 716b0cde..e354bec0 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java @@ -38,7 +38,6 @@ public void convertFromObjectTree( xmlProps.getAttrAuthoritiesCertValues(), xmlProps.getAttributeRevocationValues(), xmlProps.getAttributeCertificateRefs()) || - !xmlProps.getSigAndRefsTimeStamp().isEmpty() || !xmlProps.getRefsOnlyTimeStamp().isEmpty() || !xmlProps.getArchiveTimeStamp().isEmpty()) throw new PropertyUnmarshalException("Unsupported properties were found", "Unsupported"); diff --git a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java index 67836355..dee30c32 100644 --- a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java +++ b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java @@ -17,6 +17,7 @@ package xades4j.xml.unmarshalling; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.SigAndRefsTimeStampData; import xades4j.properties.data.SigningTimeData; import xades4j.properties.data.SigningCertificateData; import xades4j.properties.data.SignatureProdPlaceData; @@ -33,7 +34,7 @@ /** * Passed to a {@link QualifyingPropertiesUnmarshaller} to collect the property - * data obejcts. This is used instead of a collection that is returned by the unmarshaller + * data objects. This is used instead of a collection that is returned by the unmarshaller * because it allows controlling the number of occurrences of each property. *

* All the methods will throw {@code PropertyTargetException} if an attempt is made @@ -74,4 +75,6 @@ public void addIndividualDataObjsTimeStamp( public void addGenericDOMData(GenericDOMData domData); public void addOther(OtherPropertyData otherData); + + public void addSigAndRefsTimeStamp(SigAndRefsTimeStampData tsData); } diff --git a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java index 7b349aad..1768916e 100644 --- a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java +++ b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java @@ -36,6 +36,7 @@ class UnsignedSigPropsModule extends UnmarshallerModule Date: Fri, 12 Oct 2012 13:32:24 +0200 Subject: [PATCH 03/84] add tests for enriching C form to X and verification of X form Signed-off-by: Tiago Rossi --- .../verification/XadesVerifierImplTest.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/test/java/xades4j/verification/XadesVerifierImplTest.java b/src/test/java/xades4j/verification/XadesVerifierImplTest.java index d6c25b4b..b19ef8fc 100644 --- a/src/test/java/xades4j/verification/XadesVerifierImplTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierImplTest.java @@ -186,6 +186,24 @@ public void testVerifyDetachedC() throws Exception assertEquals(XAdESForm.C, res.getSignatureForm()); } + @Test + public void testVerifyCEnrichX() throws Exception + { + System.out.println("verifyCEnrichX"); + + Document doc = getDocument("document.signed.c.xml"); + Element signatureNode = getSigElement(doc); + + XadesSignatureFormatExtender formExt = new XadesFormatExtenderProfile().getFormatExtender(); + XAdESVerificationResult res = nistVerificationProfile.newVerifier().verify(signatureNode, null, formExt, XAdESForm.X); + + assertEquals(XAdESForm.C, res.getSignatureForm()); + assertPropElementPresent(signatureNode, SigAndRefsTimeStampProperty.PROP_NAME); + + outputDocument(doc, "document.verified.c.x.xml"); + + } + @Test public void testVerifyCEnrichXL() throws Exception { @@ -205,6 +223,16 @@ public void testVerifyCEnrichXL() throws Exception outputDocument(doc, "document.verified.c.xl.xml"); } + @Test + public void testVerifyX() throws Exception + { + System.out.println("verifyX"); + XAdESForm f = verifySignature( + "out/document.verified.c.x.xml", + nistVerificationProfile); + assertEquals(XAdESForm.X, f); + } + private static void assertPropElementPresent( Element sigElem, String elemName) From db4a610bac8f66140840a7484d11368ad6a9c97f Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 5 Nov 2012 14:22:14 +0100 Subject: [PATCH 04/84] preliminary support for XAdES-X-L form verification Signed-off-by: Tiago Rossi --- ...ertificateValuesVerificationException.java | 42 +++++++++++ .../CertificateValuesVerifier.java | 66 ++++++++++++++++++ .../DefaultVerificationBindingsModule.java | 6 +- .../QualifPropsDataCollectorImpl.java | 15 ++++ ...RevocationValuesVerificationException.java | 41 +++++++++++ .../RevocationValuesVerifier.java | 69 +++++++++++++++++++ .../FromXmlCertificateValuesConverter.java | 54 +++++++++++++++ .../FromXmlRevocationValuesConverter.java | 59 ++++++++++++++++ .../FromXmlUnsupportedUSPLimiter.java | 2 - .../QualifyingPropertiesDataCollector.java | 6 ++ .../unmarshalling/UnsignedSigPropsModule.java | 4 +- .../verification/XadesVerifierImplTest.java | 10 +++ 12 files changed, 370 insertions(+), 4 deletions(-) create mode 100644 src/main/java/xades4j/verification/CertificateValuesVerificationException.java create mode 100644 src/main/java/xades4j/verification/CertificateValuesVerifier.java create mode 100644 src/main/java/xades4j/verification/RevocationValuesVerificationException.java create mode 100644 src/main/java/xades4j/verification/RevocationValuesVerifier.java create mode 100644 src/main/java/xades4j/xml/unmarshalling/FromXmlCertificateValuesConverter.java create mode 100644 src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java diff --git a/src/main/java/xades4j/verification/CertificateValuesVerificationException.java b/src/main/java/xades4j/verification/CertificateValuesVerificationException.java new file mode 100644 index 00000000..fec790f9 --- /dev/null +++ b/src/main/java/xades4j/verification/CertificateValuesVerificationException.java @@ -0,0 +1,42 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.security.cert.CertificateException; + +public class CertificateValuesVerificationException extends InvalidPropertyException +{ + private static final long serialVersionUID = 1L; + + public CertificateValuesVerificationException(CertificateException ex) + { + super(ex); + } + + @Override + protected String getVerificationMessage() + { + return "Verification failure, can't parse certificates"; + } + + @Override + public String getPropertyName() + { + return "CertificateValues"; + } + +} diff --git a/src/main/java/xades4j/verification/CertificateValuesVerifier.java b/src/main/java/xades4j/verification/CertificateValuesVerifier.java new file mode 100644 index 00000000..f73c057e --- /dev/null +++ b/src/main/java/xades4j/verification/CertificateValuesVerifier.java @@ -0,0 +1,66 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import xades4j.properties.CertificateValuesProperty; +import xades4j.properties.QualifyingProperty; +import xades4j.properties.data.CertificateValuesData; + +public class CertificateValuesVerifier implements QualifyingPropertyVerifier +{ + @Override + public QualifyingProperty verify(CertificateValuesData propData, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + Collection rawCerts = propData.getData(); + CertificateFactory certFactory; + try + { + certFactory = CertificateFactory.getInstance("X509"); + } catch (CertificateException ex) + { + throw new CertificateValuesVerificationException(ex); + } + + List certificates = new ArrayList(); + + for (byte[] cert : rawCerts) + { + InputStream inStream = new ByteArrayInputStream(cert); + try + { + certificates.add((X509Certificate) certFactory.generateCertificate(inStream)); + } catch (CertificateException ex) + { + throw new CertificateValuesVerificationException(ex); + } + } + + return new CertificateValuesProperty(certificates); + } + +} diff --git a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java index 446e2e74..30219f81 100644 --- a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java +++ b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java @@ -28,6 +28,7 @@ import xades4j.properties.ObjectIdentifier; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.CertificateValuesData; import xades4j.properties.data.CommitmentTypeData; import xades4j.properties.data.CompleteCertificateRefsData; import xades4j.properties.data.CompleteRevocationRefsData; @@ -36,6 +37,7 @@ import xades4j.properties.data.GenericDOMData; import xades4j.properties.data.IndividualDataObjsTimeStampData; import xades4j.properties.data.PropertyDataObject; +import xades4j.properties.data.RevocationValuesData; import xades4j.properties.data.SigAndRefsTimeStampData; import xades4j.properties.data.SignaturePolicyData; import xades4j.properties.data.SignatureProdPlaceData; @@ -117,7 +119,9 @@ public InputStream getSignaturePolicyDocumentStream( bindBuiltInVerifier(CompleteCertificateRefsData.class, CompleteCertRefsVerifier.class); bindBuiltInVerifier(CompleteRevocationRefsData.class, CompleteRevocRefsVerifier.class); bindBuiltInVerifier(SigAndRefsTimeStampData.class, SigAndRefsTimeStampVerifier.class); - + bindBuiltInVerifier(CertificateValuesData.class, CertificateValuesVerifier.class); + bindBuiltInVerifier(RevocationValuesData.class, RevocationValuesVerifier.class); + MapBinder unkownElemsBinder = MapBinder.newMapBinder(binder(), QName.class, QualifyingPropertyVerifier.class); unkownElemsBinder .addBinding(new QName(QualifyingProperty.XADES_XMLNS, CounterSignatureProperty.PROP_NAME)) diff --git a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java index 5e560622..299a1fa2 100644 --- a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java @@ -18,11 +18,13 @@ import java.util.Collection; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.CertificateValuesData; import xades4j.properties.data.CompleteCertificateRefsData; import xades4j.properties.data.CompleteRevocationRefsData; import xades4j.properties.data.GenericDOMData; import xades4j.properties.data.IndividualDataObjsTimeStampData; import xades4j.properties.data.OtherPropertyData; +import xades4j.properties.data.RevocationValuesData; import xades4j.properties.data.SigAndRefsTimeStampData; import xades4j.properties.data.SignaturePolicyData; import xades4j.properties.data.SignatureTimeStampData; @@ -105,6 +107,18 @@ public void addSigAndRefsTimeStamp(SigAndRefsTimeStampData tsData) propsData.add(tsData); } + @Override + public void setCertificateValues(CertificateValuesData certificateValuesData) + { + propsData.add(certificateValuesData); + } + + @Override + public void setRevocationValues(RevocationValuesData revocationValuesData) + { + propsData.add(revocationValuesData); + } + @Override public void addCommitmentType(CommitmentTypeData commitmentData) { @@ -147,4 +161,5 @@ Collection getPropertiesData() { return propsData.getProperties(); } + } diff --git a/src/main/java/xades4j/verification/RevocationValuesVerificationException.java b/src/main/java/xades4j/verification/RevocationValuesVerificationException.java new file mode 100644 index 00000000..3a4afeab --- /dev/null +++ b/src/main/java/xades4j/verification/RevocationValuesVerificationException.java @@ -0,0 +1,41 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +public class RevocationValuesVerificationException extends + InvalidPropertyException +{ + private static final long serialVersionUID = 1L; + + public RevocationValuesVerificationException(Exception ex) + { + super(ex); + } + + @Override + protected String getVerificationMessage() + { + return "Can't verify revocation information"; + } + + @Override + public String getPropertyName() + { + return "RevocationValues"; + } + +} diff --git a/src/main/java/xades4j/verification/RevocationValuesVerifier.java b/src/main/java/xades4j/verification/RevocationValuesVerifier.java new file mode 100644 index 00000000..7c34b17f --- /dev/null +++ b/src/main/java/xades4j/verification/RevocationValuesVerifier.java @@ -0,0 +1,69 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.security.cert.CRLException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509CRL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import xades4j.properties.QualifyingProperty; +import xades4j.properties.RevocationValuesProperty; +import xades4j.properties.data.RevocationValuesData; + +public class RevocationValuesVerifier implements + QualifyingPropertyVerifier +{ + + @Override + public QualifyingProperty verify(RevocationValuesData propData, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + Collection rawRevocationData = propData.getData(); + CertificateFactory certFactory; + try + { + certFactory = CertificateFactory.getInstance("X509"); + } catch (CertificateException ex) + { + throw new RevocationValuesVerificationException(ex); + } + + List crls = new ArrayList(); + + for (byte[] crl : rawRevocationData) + { + InputStream inStream = new ByteArrayInputStream(crl); + try + { + crls.add((X509CRL) certFactory.generateCRL(inStream)); + } catch (CRLException ex) + { + throw new RevocationValuesVerificationException(ex); + } + } + + return new RevocationValuesProperty(crls); + } + +} diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlCertificateValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlCertificateValuesConverter.java new file mode 100644 index 00000000..a4b2d231 --- /dev/null +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlCertificateValuesConverter.java @@ -0,0 +1,54 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.unmarshalling; + +import java.util.List; + +import xades4j.properties.data.CertificateValuesData; +import xades4j.xml.bind.xades.XmlAnyType; +import xades4j.xml.bind.xades.XmlCertificateValuesType; +import xades4j.xml.bind.xades.XmlEncapsulatedPKIDataType; +import xades4j.xml.bind.xades.XmlUnsignedSignaturePropertiesType; + +public class FromXmlCertificateValuesConverter implements UnsignedSigPropFromXmlConv +{ + @Override + public void convertFromObjectTree( + XmlUnsignedSignaturePropertiesType xmlProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { + XmlCertificateValuesType xmlCertificateValues = xmlProps.getCertificateValues(); + if (null == xmlCertificateValues) + return; + + CertificateValuesData certificateValuesData = new CertificateValuesData(); + List values = xmlCertificateValues.getEncapsulatedX509CertificateOrOtherCertificate(); + for (Object item : values) + { + if (item instanceof XmlEncapsulatedPKIDataType) + { + XmlEncapsulatedPKIDataType cert = (XmlEncapsulatedPKIDataType) item; + certificateValuesData.addData(cert.getValue()); + } + if (item instanceof XmlAnyType) + throw new PropertyUnmarshalException("Property not supported", "OtherCertificate"); + } + + propertyDataCollector.setCertificateValues(certificateValuesData); + } +} diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java new file mode 100644 index 00000000..b15a1860 --- /dev/null +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java @@ -0,0 +1,59 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.unmarshalling; + +import java.util.List; + +import xades4j.properties.data.RevocationValuesData; +import xades4j.xml.bind.xades.XmlCRLValuesType; +import xades4j.xml.bind.xades.XmlEncapsulatedPKIDataType; +import xades4j.xml.bind.xades.XmlRevocationValuesType; +import xades4j.xml.bind.xades.XmlUnsignedSignaturePropertiesType; + +public class FromXmlRevocationValuesConverter implements UnsignedSigPropFromXmlConv +{ + + @Override + public void convertFromObjectTree( + XmlUnsignedSignaturePropertiesType xmlProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { + XmlRevocationValuesType xmlRevocationValues = xmlProps.getRevocationValues(); + if (null == xmlRevocationValues) + return; + + RevocationValuesData revocationValuesData = new RevocationValuesData(); + XmlCRLValuesType values = xmlRevocationValues.getCRLValues(); + List crls = values.getEncapsulatedCRLValue(); + for (XmlEncapsulatedPKIDataType crl : crls) + { + revocationValuesData.addData(crl.getValue()); + } + + // handle unsupported data + if (xmlRevocationValues.getOCSPValues() != null) + throw new PropertyUnmarshalException("OCSP responses are unsupported", + "RevocationValues"); + if (xmlRevocationValues.getOtherValues() != null) + throw new PropertyUnmarshalException("Other (not CRL and not OCSP) " + + "certificate revocation values unsupported", "RevocationValues"); + + propertyDataCollector.setRevocationValues(revocationValuesData); + } + +} diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java index e354bec0..77f97020 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java @@ -33,8 +33,6 @@ public void convertFromObjectTree( if (!ObjectUtils.allNull( xmlProps.getAttributeCertificateRefs(), xmlProps.getAttributeRevocationRefs(), - xmlProps.getCertificateValues(), - xmlProps.getRevocationValues(), xmlProps.getAttrAuthoritiesCertValues(), xmlProps.getAttributeRevocationValues(), xmlProps.getAttributeCertificateRefs()) || diff --git a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java index dee30c32..dc0a2302 100644 --- a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java +++ b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java @@ -17,6 +17,8 @@ package xades4j.xml.unmarshalling; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.CertificateValuesData; +import xades4j.properties.data.RevocationValuesData; import xades4j.properties.data.SigAndRefsTimeStampData; import xades4j.properties.data.SigningTimeData; import xades4j.properties.data.SigningCertificateData; @@ -77,4 +79,8 @@ public void addIndividualDataObjsTimeStamp( public void addOther(OtherPropertyData otherData); public void addSigAndRefsTimeStamp(SigAndRefsTimeStampData tsData); + + public void setCertificateValues(CertificateValuesData certificateValuesData); + + public void setRevocationValues(RevocationValuesData revocationValuesData); } diff --git a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java index 1768916e..35635236 100644 --- a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java +++ b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java @@ -32,11 +32,13 @@ class UnsignedSigPropsModule extends UnmarshallerModule Date: Fri, 26 Oct 2012 16:47:38 +0200 Subject: [PATCH 05/84] extract certs and CRLs from -X-L form tags CertificateValues and RevocationValues contain certificates, CRLs and OCSP responses that can be useful in validation of Signature. Parse them and add to intermediate certs and CRLs CertStore for later use Signed-off-by: Tiago Rossi --- .../CertificateValidationProvider.java | 30 +++ .../PKIXCertificateValidationProvider.java | 173 +++++++++++++++++- .../verification/XadesVerifierImpl.java | 71 ++++++- 3 files changed, 272 insertions(+), 2 deletions(-) diff --git a/src/main/java/xades4j/providers/CertificateValidationProvider.java b/src/main/java/xades4j/providers/CertificateValidationProvider.java index 9216ce38..7e2af78e 100644 --- a/src/main/java/xades4j/providers/CertificateValidationProvider.java +++ b/src/main/java/xades4j/providers/CertificateValidationProvider.java @@ -16,6 +16,7 @@ */ package xades4j.providers; +import java.security.cert.X509CRL; import java.security.cert.X509CertSelector; import java.security.cert.X509Certificate; import java.util.Collection; @@ -46,4 +47,33 @@ ValidationData validate( X509CertSelector certSelector, Date validationDate, Collection otherCerts) throws CertificateValidationException, UnexpectedJCAException; + + /** + * adds CRLs to certificate stores of this validation provider, later to be used to + * validate certificates + *

+ * CRLs are validated whatever they have been signed by a trusted CA using trustworthy + * algorithms at time {@code now}. + *

+ *

+ * invalid CRLs are ignored + *

+ * @param crls set of CRLs to add + * @param now date at which the CRL has to be valid (isn't published after this date, + * CA that issued this CRL links to a valid trust anchor and used algorithms have + * been safe at this point in time) + */ + void addCRLs(Collection crls, Date now); + + /** + * adds intermediate and end-entity certificates used for creating cert paths + *

+ * Certificates are validated whatever they have been issued by a valid trust anchor + * at time {@code now} and using algorithms that have been safe at this point in time + *

invalid Certificates are ignored, certificates are not validated + * using CRLs or OCSP + * @param otherCerts set of certificates to add + * @param now time of validation for added certificates + */ + void addCertificates(Collection otherCerts, Date now); } diff --git a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProvider.java b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProvider.java index be297e3a..55a06c8b 100644 --- a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProvider.java +++ b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProvider.java @@ -21,10 +21,12 @@ import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; +import java.security.PublicKey; import java.security.cert.CertPathBuilder; import java.security.cert.CertPathBuilderException; import java.security.cert.CertStore; import java.security.cert.CertStoreException; +import java.security.cert.Certificate; import java.security.cert.CollectionCertStoreParameters; import java.security.cert.PKIXBuilderParameters; import java.security.cert.PKIXCertPathBuilderResult; @@ -33,6 +35,7 @@ import java.security.cert.X509CertSelector; import java.security.cert.X509Certificate; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -42,6 +45,7 @@ import java.util.Map; import java.util.Set; import javax.security.auth.x500.X500Principal; + import xades4j.providers.CannotBuildCertificationPathException; import xades4j.providers.CannotSelectCertificateException; import xades4j.providers.CertificateValidationException; @@ -64,7 +68,7 @@ public class PKIXCertificateValidationProvider implements CertificateValidationP private final KeyStore trustAnchors; private final boolean revocationEnabled; private final int maxPathLength; - private final CertStore[] intermCertsAndCrls; + private CertStore[] intermCertsAndCrls; private final CertPathBuilder certPathBuilder; private final String signatureProvider; @@ -348,4 +352,171 @@ private Collection getCRLsForCertPath( } return crls; } + + @Override + public void addCRLs(Collection crls, Date now) + { + Collection validCRLs = new ArrayList(); + + for(X509CRL crl : crls) + { + // check if it's not CRL from "future" + if (crl.getThisUpdate().getTime() > now.getTime()) + continue; + + // TODO check algorithms used in CRL + + X509CertSelector certSel = new X509CertSelector(); + certSel.setSubject(crl.getIssuerX500Principal()); + + PKIXBuilderParameters params; + try + { + params = new PKIXBuilderParameters(trustAnchors, certSel); + } catch (Exception e) + { + // parameters are invalid, ignore CRL + continue; + } + params.setDate(now); + params.setRevocationEnabled(false); + for (int i=0; i < intermCertsAndCrls.length; i++) + { + params.addCertStore(intermCertsAndCrls[i]); + } + + PKIXCertPathBuilderResult res; + try + { + res = (PKIXCertPathBuilderResult) this.certPathBuilder.build(params); + } catch (Exception ex) + { + // CRL is invalid, ignore + continue; + } + + List certs = new ArrayList(res.getCertPath().getCertificates()); + // TODO check algorithms used in this cert path + PublicKey crlSigningKey; + if (certs.size() != 0) + crlSigningKey = ((Certificate)certs.get(0)).getPublicKey(); + else + crlSigningKey = res.getTrustAnchor().getCAPublicKey(); + if (crlSigningKey == null) + crlSigningKey = res.getTrustAnchor().getTrustedCert().getPublicKey(); + + try + { + crl.verify(crlSigningKey); + } catch (Exception ex) + { + // invalid CRL, ignore + continue; + } + + validCRLs.add(crl); + } + + // don't create empty CertStores + if (validCRLs.size() == 0) + return; + + CollectionCertStoreParameters ccsp = new CollectionCertStoreParameters(validCRLs); + CertStore crlsCertStore; + try + { + crlsCertStore = CertStore.getInstance("Collection", ccsp); + } catch (Exception e) + { + throw new RuntimeException("General crypto failure", e); + } + + CertStore[] newIntermCertsAndCrls; + newIntermCertsAndCrls = Arrays.copyOf(intermCertsAndCrls, intermCertsAndCrls.length + 1); + newIntermCertsAndCrls[intermCertsAndCrls.length] = crlsCertStore; + + intermCertsAndCrls = newIntermCertsAndCrls; + } + + @Override + public void addCertificates(Collection otherCerts, Date now) + { + Collection validCerts = new ArrayList(); + + /* + * To validate certificates we need to have all issuer certificates. + * Needed issuer certificates can be among otherCerts. + * + * To work around this problem, we include otherCerts in PKIXBuilderParameters + * but add them to intermCertsAndCrls only if they validate successfully. + */ + CollectionCertStoreParameters ccsp = new CollectionCertStoreParameters(otherCerts); + CertStore otherCertsCertStore; + try + { + otherCertsCertStore = CertStore.getInstance("Collection", ccsp); + } catch (Exception ex) + { + throw new RuntimeException("General crypto failure", ex); + } + + // find good certificates + for (X509Certificate cert : otherCerts) + { + // TODO check algorithms used in certificate creation + + // TODO iff certificate matches entry in TSL, add them to trustAnchors + + X509CertSelector certSel = new X509CertSelector(); + certSel.setCertificate(cert); + + PKIXBuilderParameters params; + try { + params = new PKIXBuilderParameters(trustAnchors, certSel); + } catch (Exception e) + { + // parameters are invalid, ignore certificate + continue; + } + params.setDate(now); + params.setRevocationEnabled(false); + for (int i=0; i < intermCertsAndCrls.length; i++) + { + params.addCertStore(intermCertsAndCrls[i]); + } + params.addCertStore(otherCertsCertStore); + + PKIXCertPathBuilderResult res; + try + { + res = (PKIXCertPathBuilderResult)this.certPathBuilder.build(params); + } catch (Exception ex) + { + // certificate or certificates invalid, ignore + continue; + } + + List certs = res.getCertPath().getCertificates(); + if (certs.size() == 0) // cert is a trustAnchor, we can ignore it + continue; + + validCerts.add(cert); + } + + ccsp = new CollectionCertStoreParameters(validCerts); + CertStore validCertCertStore; + try + { + validCertCertStore = CertStore.getInstance("Collection", ccsp); + } catch (Exception e) + { + throw new RuntimeException("General crypto failure", e); + } + + CertStore[] newIntermCertsAndCrls; + newIntermCertsAndCrls = Arrays.copyOf(intermCertsAndCrls, intermCertsAndCrls.length + 1); + newIntermCertsAndCrls[intermCertsAndCrls.length] = validCertCertStore; + + intermCertsAndCrls = newIntermCertsAndCrls; + } } diff --git a/src/main/java/xades4j/verification/XadesVerifierImpl.java b/src/main/java/xades4j/verification/XadesVerifierImpl.java index 443460d3..5f054071 100644 --- a/src/main/java/xades4j/verification/XadesVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesVerifierImpl.java @@ -34,11 +34,16 @@ import org.apache.xml.security.utils.resolver.implementations.ResolverAnonymous; import org.w3c.dom.Element; import org.w3c.dom.Node; + +import xades4j.properties.CertificateValuesProperty; import xades4j.properties.QualifyingProperty; +import xades4j.properties.RevocationValuesProperty; import xades4j.properties.UnsignedSignatureProperty; import xades4j.XAdES4jException; import xades4j.XAdES4jXMLSigException; +import xades4j.properties.data.CertificateValuesData; import xades4j.properties.data.PropertyDataObject; +import xades4j.properties.data.RevocationValuesData; import xades4j.properties.UnsignedProperties; import xades4j.production.XadesSignatureFormatExtender; import xades4j.properties.SignatureTimeStampProperty; @@ -168,6 +173,12 @@ public XAdESVerificationResult verify(Element signatureElem, SignatureSpecificVe qualifPropsUnmarshaller.unmarshalProperties(qualifyingPropsElem, propsDataCollector); Collection qualifPropsData = propsDataCollector.getPropertiesData(); + /* Read certificates and revocation values from extended forms */ + Collection crls = getRevocationValues(qualifPropsData, signature); + Collection otherCerts = getCertificateValues(qualifPropsData, signature); + this.certificateValidator.addCRLs(crls, new Date()); + this.certificateValidator.addCertificates(otherCerts, new Date()); + /* Certification path */ KeyInfoRes keyInfoRes = SignatureUtils.processKeyInfo(signature.getKeyInfo()); @@ -217,7 +228,7 @@ public XAdESVerificationResult verify(Element signatureElem, SignatureSpecificVe return res; } - + /*************************************************************************************/ /**/ @@ -252,6 +263,64 @@ private Date getValidationDate( return ((SignatureTimeStampProperty) sigTs).getTime(); } + private Collection getCertificateValues( + Collection qualifPropsData, + XMLSignature signature) throws XAdES4jException + { + List certValData = CollectionUtils.filterByType(qualifPropsData, CertificateValuesData.class); + + // If no signature time-stamp is present, use the current date. + if (certValData.isEmpty()) + { + return new ArrayList(); + } + + // This is a temporary solution. + // - Properties should probably be verified in two stages (before and after cert path creation). + QualifyingPropertyVerificationContext ctx = new QualifyingPropertyVerificationContext( + signature, + new QualifyingPropertyVerificationContext.CertificationChainData( + new ArrayList(0), + new ArrayList(0), + null), + /**/ + new QualifyingPropertyVerificationContext.SignedObjectsData( + new ArrayList(0), + signature)); + QualifyingProperty certVal = this.qualifyingPropertiesVerifier.verifyProperties(certValData, ctx).iterator().next().getProperty(); + + return ((CertificateValuesProperty) certVal).getCertificates(); + } + + private Collection getRevocationValues( + Collection qualifPropsData, + XMLSignature signature) throws XAdES4jException + { + List revValData = CollectionUtils.filterByType(qualifPropsData, RevocationValuesData.class); + + // If no signature time-stamp is present, use the current date. + if (revValData.isEmpty()) + { + return new ArrayList(); + } + + // This is a temporary solution. + // - Properties should probably be verified in two stages (before and after cert path creation). + QualifyingPropertyVerificationContext ctx = new QualifyingPropertyVerificationContext( + signature, + new QualifyingPropertyVerificationContext.CertificationChainData( + new ArrayList(0), + new ArrayList(0), + null), + /**/ + new QualifyingPropertyVerificationContext.SignedObjectsData( + new ArrayList(0), + signature)); + QualifyingProperty revVal = this.qualifyingPropertiesVerifier.verifyProperties(revValData, ctx).iterator().next().getProperty(); + + return ((RevocationValuesProperty) revVal).getCrls(); + } + private static void doCoreVerification( XMLSignature signature, SignatureSpecificVerificationOptions verificationOptions, From bf1fa0dbf62d10b8cf36c3e6b5f934ffed95d548 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 30 Oct 2012 11:33:26 +0100 Subject: [PATCH 06/84] add support for AttrAuthoritiesCertValues and AttributeRevocationValues Signed-off-by: Tiago Rossi --- .../DataGenAttrAuthoritiesCertValues.java | 54 ++++++++++++++ .../DataGenAttributeRevocationValues.java | 53 +++++++++++++ .../DefaultProductionBindingsModule.java | 10 +++ .../AttrAuthoritiesCertValuesProperty.java | 56 ++++++++++++++ .../AttributeRevocationValuesProperty.java | 55 ++++++++++++++ .../data/AttrAuthoritiesCertValuesData.java | 24 ++++++ .../data/AttributeRevocationValuesData.java | 21 ++++++ ...ropertiesDataObjectsStructureVerifier.java | 8 ++ .../java/xades4j/utils/PropertiesUtils.java | 2 + .../AttrAuthoritiesCertValuesVerifier.java | 47 ++++++++++++ .../AttributeRevocationValuesVerifier.java | 42 +++++++++++ .../CertificateValuesVerifier.java | 52 ++++--------- .../DefaultVerificationBindingsModule.java | 4 + ...psulatedPKIDataVerificationException.java} | 8 +- .../EncapsulatedPKIDataVerifierBase.java | 74 +++++++++++++++++++ ...IRevocationDataVerificationException.java} | 8 +- ...psulatedPKIRevocationDataVerifierBase.java | 74 +++++++++++++++++++ .../QualifPropsDataCollectorImpl.java | 14 ++++ .../RevocationValuesVerifier.java | 51 ++++--------- .../DefaultUnsignedPropertiesMarshaller.java | 4 + ...XmlAttrAuthoritiesCertValuesConverter.java | 53 +++++++++++++ ...XmlAttributeRevocationValuesConverter.java | 56 ++++++++++++++ ...XmlAttrAuthoritiesCertValuesConverter.java | 57 ++++++++++++++ ...XmlAttributeRevocationValuesConverter.java | 59 +++++++++++++++ .../FromXmlRevocationValuesConverter.java | 2 - .../FromXmlUnsupportedUSPLimiter.java | 2 - .../QualifyingPropertiesDataCollector.java | 8 ++ .../unmarshalling/UnsignedSigPropsModule.java | 2 + 28 files changed, 817 insertions(+), 83 deletions(-) create mode 100644 src/main/java/xades4j/production/DataGenAttrAuthoritiesCertValues.java create mode 100644 src/main/java/xades4j/production/DataGenAttributeRevocationValues.java create mode 100644 src/main/java/xades4j/properties/AttrAuthoritiesCertValuesProperty.java create mode 100644 src/main/java/xades4j/properties/AttributeRevocationValuesProperty.java create mode 100644 src/main/java/xades4j/properties/data/AttrAuthoritiesCertValuesData.java create mode 100644 src/main/java/xades4j/properties/data/AttributeRevocationValuesData.java create mode 100644 src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java create mode 100644 src/main/java/xades4j/verification/AttributeRevocationValuesVerifier.java rename src/main/java/xades4j/verification/{CertificateValuesVerificationException.java => EncapsulatedPKIDataVerificationException.java} (80%) create mode 100644 src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java rename src/main/java/xades4j/verification/{RevocationValuesVerificationException.java => EncapsulatedPKIRevocationDataVerificationException.java} (81%) create mode 100644 src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java create mode 100644 src/main/java/xades4j/xml/marshalling/ToXmlAttrAuthoritiesCertValuesConverter.java create mode 100644 src/main/java/xades4j/xml/marshalling/ToXmlAttributeRevocationValuesConverter.java create mode 100644 src/main/java/xades4j/xml/unmarshalling/FromXmlAttrAuthoritiesCertValuesConverter.java create mode 100644 src/main/java/xades4j/xml/unmarshalling/FromXmlAttributeRevocationValuesConverter.java diff --git a/src/main/java/xades4j/production/DataGenAttrAuthoritiesCertValues.java b/src/main/java/xades4j/production/DataGenAttrAuthoritiesCertValues.java new file mode 100644 index 00000000..3da272bb --- /dev/null +++ b/src/main/java/xades4j/production/DataGenAttrAuthoritiesCertValues.java @@ -0,0 +1,54 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.production; + +import java.security.cert.CertificateEncodingException; +import java.security.cert.X509Certificate; + +import xades4j.properties.AttrAuthoritiesCertValuesProperty; +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.properties.data.CertificateValuesData; +import xades4j.properties.data.PropertyDataObject; + +/** + * @author Hubert Kario + */ +public class DataGenAttrAuthoritiesCertValues + implements PropertyDataObjectGenerator +{ + @Override + public PropertyDataObject generatePropertyData( + AttrAuthoritiesCertValuesProperty prop, + PropertiesDataGenerationContext ctx) + throws PropertyDataGenerationException + { + AttrAuthoritiesCertValuesData attrAuthCertValuesData = + new AttrAuthoritiesCertValuesData(); + try + { + for (X509Certificate cer : prop.getCertificates()) + { + attrAuthCertValuesData.addData(cer.getEncoded()); + } + } catch (CertificateEncodingException ex) + { + throw new PropertyDataGenerationException(prop, "cannot get encoded certificate", ex); + } + + return attrAuthCertValuesData; + } +} diff --git a/src/main/java/xades4j/production/DataGenAttributeRevocationValues.java b/src/main/java/xades4j/production/DataGenAttributeRevocationValues.java new file mode 100644 index 00000000..d17cb6a9 --- /dev/null +++ b/src/main/java/xades4j/production/DataGenAttributeRevocationValues.java @@ -0,0 +1,53 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.production; + +import java.security.cert.CRLException; +import java.security.cert.X509CRL; + +import xades4j.properties.AttributeRevocationValuesProperty; +import xades4j.properties.data.AttributeRevocationValuesData; +import xades4j.properties.data.PropertyDataObject; + +/** + * + * @author Hubert Kario + * + */ +public class DataGenAttributeRevocationValues implements + PropertyDataObjectGenerator +{ + @Override + public PropertyDataObject generatePropertyData( + AttributeRevocationValuesProperty prop, + PropertiesDataGenerationContext ctx) + throws PropertyDataGenerationException + { + AttributeRevocationValuesData attrRevocValuesData = new AttributeRevocationValuesData(); + try + { + for (X509CRL crl : prop.getCrls()) + { + attrRevocValuesData.addData(crl.getEncoded()); + } + } catch (CRLException ex) + { + throw new PropertyDataGenerationException(prop, "cannot get encoded CRL", ex); + } + return attrRevocValuesData; + } +} diff --git a/src/main/java/xades4j/production/DefaultProductionBindingsModule.java b/src/main/java/xades4j/production/DefaultProductionBindingsModule.java index 45de4747..1b42442b 100644 --- a/src/main/java/xades4j/production/DefaultProductionBindingsModule.java +++ b/src/main/java/xades4j/production/DefaultProductionBindingsModule.java @@ -22,6 +22,8 @@ import xades4j.properties.AllDataObjsCommitmentTypeProperty; import xades4j.properties.AllDataObjsTimeStampProperty; import xades4j.properties.ArchiveTimeStampProperty; +import xades4j.properties.AttrAuthoritiesCertValuesProperty; +import xades4j.properties.AttributeRevocationValuesProperty; import xades4j.properties.CertificateValuesProperty; import xades4j.properties.CommitmentTypeProperty; import xades4j.properties.CompleteCertificateRefsProperty; @@ -161,10 +163,18 @@ public void provideProperties(DataObjectDesc dataObj) { }).to(DataGenCertificateValues.class); + bind(new TypeLiteral>() + { + }).to(DataGenAttrAuthoritiesCertValues.class); + bind(new TypeLiteral>() { }).to(DataGenRevocationValues.class); + bind(new TypeLiteral>() + { + }).to(DataGenAttributeRevocationValues.class); + bind(new TypeLiteral>() { }).to(DataGenArchiveTimeStamp.class); diff --git a/src/main/java/xades4j/properties/AttrAuthoritiesCertValuesProperty.java b/src/main/java/xades4j/properties/AttrAuthoritiesCertValuesProperty.java new file mode 100644 index 00000000..39b29737 --- /dev/null +++ b/src/main/java/xades4j/properties/AttrAuthoritiesCertValuesProperty.java @@ -0,0 +1,56 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.properties; + +import java.security.cert.X509Certificate; +import java.util.Collection; + +/** + * The {@code AttrAuthoritiesCertValues} is an optional unsigned property and qualifies + * the XML signatures. There can be at most one occurrence of this property in the + * signature. + *

+ * This element should have the full set of certificates that are needed to verify + * time stamps in {@code SignatureTimeStamp}, {@code SigAndRefsTimeStamp} and + * {@code RefsOnlyTimeStamp}. + * This property is optional part of XAdES-X-L form. + * @author Hubert Kario + */ +public final class AttrAuthoritiesCertValuesProperty extends UnsignedSignatureProperty +{ + + public static final String PROP_NAME = "AttrAuthoritiesCertValues"; + private final Collection certificates; + + public AttrAuthoritiesCertValuesProperty(Collection certificates) + { + if (null == certificates) + throw new NullPointerException(); + this.certificates = certificates; + } + + public Collection getCertificates() + { + return certificates; + } + + @Override + public String getName() + { + return PROP_NAME; + } +} diff --git a/src/main/java/xades4j/properties/AttributeRevocationValuesProperty.java b/src/main/java/xades4j/properties/AttributeRevocationValuesProperty.java new file mode 100644 index 00000000..ed7a9179 --- /dev/null +++ b/src/main/java/xades4j/properties/AttributeRevocationValuesProperty.java @@ -0,0 +1,55 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.properties; + +import java.security.cert.X509CRL; +import java.util.Collection; + +/** + * The {@code AttributeRevocationValues} property is an optional unsigned property and + * qualifies the XML signature. There is at most one occurrence of this property in the + * signature. + *

+ * The {@code AttributeRevocationValues} property is used to hold the values of revocation + * information which are needed to check validity of TSA certificates in TimeStamps. + * + * @author Hubert Kario + * + */ +public class AttributeRevocationValuesProperty extends + UnsignedSignatureProperty +{ + public static final String PROP_NAME = "AttributeRevocationValues"; + private final Collection crls; + + public AttributeRevocationValuesProperty(Collection crls) + { + if (crls == null) + throw new NullPointerException(); + this.crls = crls; + } + public Collection getCrls() + { + return crls; + } + + @Override + public String getName() + { + return PROP_NAME; + } +} diff --git a/src/main/java/xades4j/properties/data/AttrAuthoritiesCertValuesData.java b/src/main/java/xades4j/properties/data/AttrAuthoritiesCertValuesData.java new file mode 100644 index 00000000..e666feaa --- /dev/null +++ b/src/main/java/xades4j/properties/data/AttrAuthoritiesCertValuesData.java @@ -0,0 +1,24 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.properties.data; + +/** + * @author Hubert Kario + */ +public class AttrAuthoritiesCertValuesData extends BaseEncapsulatedPKIData +{ +} diff --git a/src/main/java/xades4j/properties/data/AttributeRevocationValuesData.java b/src/main/java/xades4j/properties/data/AttributeRevocationValuesData.java new file mode 100644 index 00000000..e1531dac --- /dev/null +++ b/src/main/java/xades4j/properties/data/AttributeRevocationValuesData.java @@ -0,0 +1,21 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.properties.data; + +public class AttributeRevocationValuesData extends BaseEncapsulatedPKIData +{ +} diff --git a/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java b/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java index 2316b8a0..d72dd35c 100644 --- a/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java +++ b/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java @@ -25,6 +25,8 @@ import java.util.Set; import xades4j.properties.AllDataObjsTimeStampProperty; import xades4j.properties.ArchiveTimeStampProperty; +import xades4j.properties.AttrAuthoritiesCertValuesProperty; +import xades4j.properties.AttributeRevocationValuesProperty; import xades4j.properties.CertificateValuesProperty; import xades4j.properties.CompleteCertificateRefsProperty; import xades4j.properties.RevocationValuesProperty; @@ -86,9 +88,15 @@ public class PropertiesDataObjectsStructureVerifier structureVerifiers.put(CertificateValuesData.class, new BaseEncapsulatedPKIDataStructureVerifier(CertificateValuesProperty.PROP_NAME)); + structureVerifiers.put(AttrAuthoritiesCertValuesData.class, + new BaseEncapsulatedPKIDataStructureVerifier(AttrAuthoritiesCertValuesProperty.PROP_NAME)); + structureVerifiers.put(RevocationValuesData.class, new BaseEncapsulatedPKIDataStructureVerifier(RevocationValuesProperty.PROP_NAME)); + structureVerifiers.put(AttributeRevocationValuesData.class, + new BaseEncapsulatedPKIDataStructureVerifier(AttributeRevocationValuesProperty.PROP_NAME)); + structureVerifiers.put(ArchiveTimeStampData.class, new BaseXAdESTimeStampDataStructureVerifier(ArchiveTimeStampProperty.PROP_NAME)); diff --git a/src/main/java/xades4j/utils/PropertiesUtils.java b/src/main/java/xades4j/utils/PropertiesUtils.java index c8184a83..d12d7b45 100644 --- a/src/main/java/xades4j/utils/PropertiesUtils.java +++ b/src/main/java/xades4j/utils/PropertiesUtils.java @@ -83,6 +83,8 @@ public static void addXadesXLProperties( { usp.add(new CertificateValuesProperty(vData.getCerts())); usp.add(new RevocationValuesProperty(vData.getCrls())); + // TODO add AttrAuthoritiesCertValues + // TODO add AttributeRevocationValues } public static void addXadesAProperties( diff --git a/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java b/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java new file mode 100644 index 00000000..1ef3ec88 --- /dev/null +++ b/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java @@ -0,0 +1,47 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.security.cert.X509Certificate; +import java.util.Collection; + +import com.google.inject.Inject; + +import xades4j.properties.AttrAuthoritiesCertValuesProperty; +import xades4j.properties.QualifyingProperty; +import xades4j.properties.data.AttrAuthoritiesCertValuesData; + +/** + * + * @author Hubert Kario + * + */ +public class AttrAuthoritiesCertValuesVerifier extends EncapsulatedPKIDataVerifierBase +{ + @Inject + public AttrAuthoritiesCertValuesVerifier(String propName) + { + super(propName); + } + + @Override + public QualifyingProperty createProperty(Collection certs) + { + return new AttrAuthoritiesCertValuesProperty(certs); + } + +} diff --git a/src/main/java/xades4j/verification/AttributeRevocationValuesVerifier.java b/src/main/java/xades4j/verification/AttributeRevocationValuesVerifier.java new file mode 100644 index 00000000..7d29b0b1 --- /dev/null +++ b/src/main/java/xades4j/verification/AttributeRevocationValuesVerifier.java @@ -0,0 +1,42 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.security.cert.X509CRL; +import java.util.Collection; + +import com.google.inject.Inject; + +import xades4j.properties.AttributeRevocationValuesProperty; +import xades4j.properties.QualifyingProperty; +import xades4j.properties.data.AttributeRevocationValuesData; + +public class AttributeRevocationValuesVerifier + extends EncapsulatedPKIRevocationDataVerifierBase +{ + @Inject + public AttributeRevocationValuesVerifier(String propName) + { + super(propName); + } + + @Override + public QualifyingProperty createProperty(Collection crls) + { + return new AttributeRevocationValuesProperty(crls); + } +} diff --git a/src/main/java/xades4j/verification/CertificateValuesVerifier.java b/src/main/java/xades4j/verification/CertificateValuesVerifier.java index f73c057e..c7cdbb2a 100644 --- a/src/main/java/xades4j/verification/CertificateValuesVerifier.java +++ b/src/main/java/xades4j/verification/CertificateValuesVerifier.java @@ -16,51 +16,31 @@ */ package xades4j.verification; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; + +import com.google.inject.Inject; import xades4j.properties.CertificateValuesProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.CertificateValuesData; -public class CertificateValuesVerifier implements QualifyingPropertyVerifier +/** + * + * @author Hubert Kario + * + */ +public class CertificateValuesVerifier extends EncapsulatedPKIDataVerifierBase { - @Override - public QualifyingProperty verify(CertificateValuesData propData, - QualifyingPropertyVerificationContext ctx) - throws InvalidPropertyException + @Inject + public CertificateValuesVerifier(String propName) { - Collection rawCerts = propData.getData(); - CertificateFactory certFactory; - try - { - certFactory = CertificateFactory.getInstance("X509"); - } catch (CertificateException ex) - { - throw new CertificateValuesVerificationException(ex); - } - - List certificates = new ArrayList(); - - for (byte[] cert : rawCerts) - { - InputStream inStream = new ByteArrayInputStream(cert); - try - { - certificates.add((X509Certificate) certFactory.generateCertificate(inStream)); - } catch (CertificateException ex) - { - throw new CertificateValuesVerificationException(ex); - } - } - - return new CertificateValuesProperty(certificates); + super(propName); } + @Override + public QualifyingProperty createProperty(Collection certs) + { + return new CertificateValuesProperty(certs); + } } diff --git a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java index 30219f81..6e729185 100644 --- a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java +++ b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java @@ -28,6 +28,8 @@ import xades4j.properties.ObjectIdentifier; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; import xades4j.properties.data.CommitmentTypeData; import xades4j.properties.data.CompleteCertificateRefsData; @@ -120,7 +122,9 @@ public InputStream getSignaturePolicyDocumentStream( bindBuiltInVerifier(CompleteRevocationRefsData.class, CompleteRevocRefsVerifier.class); bindBuiltInVerifier(SigAndRefsTimeStampData.class, SigAndRefsTimeStampVerifier.class); bindBuiltInVerifier(CertificateValuesData.class, CertificateValuesVerifier.class); + bindBuiltInVerifier(AttrAuthoritiesCertValuesData.class, AttrAuthoritiesCertValuesVerifier.class); bindBuiltInVerifier(RevocationValuesData.class, RevocationValuesVerifier.class); + bindBuiltInVerifier(AttributeRevocationValuesData.class, AttributeRevocationValuesVerifier.class); MapBinder unkownElemsBinder = MapBinder.newMapBinder(binder(), QName.class, QualifyingPropertyVerifier.class); unkownElemsBinder diff --git a/src/main/java/xades4j/verification/CertificateValuesVerificationException.java b/src/main/java/xades4j/verification/EncapsulatedPKIDataVerificationException.java similarity index 80% rename from src/main/java/xades4j/verification/CertificateValuesVerificationException.java rename to src/main/java/xades4j/verification/EncapsulatedPKIDataVerificationException.java index fec790f9..601cb3bc 100644 --- a/src/main/java/xades4j/verification/CertificateValuesVerificationException.java +++ b/src/main/java/xades4j/verification/EncapsulatedPKIDataVerificationException.java @@ -18,13 +18,15 @@ import java.security.cert.CertificateException; -public class CertificateValuesVerificationException extends InvalidPropertyException +public class EncapsulatedPKIDataVerificationException extends InvalidPropertyException { private static final long serialVersionUID = 1L; + private final String propName; - public CertificateValuesVerificationException(CertificateException ex) + public EncapsulatedPKIDataVerificationException(CertificateException ex, String propName) { super(ex); + this.propName = propName; } @Override @@ -36,7 +38,7 @@ protected String getVerificationMessage() @Override public String getPropertyName() { - return "CertificateValues"; + return propName; } } diff --git a/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java b/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java new file mode 100644 index 00000000..a8dad306 --- /dev/null +++ b/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java @@ -0,0 +1,74 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import xades4j.properties.CertificateValuesProperty; +import xades4j.properties.QualifyingProperty; +import xades4j.properties.data.BaseEncapsulatedPKIData; + +public abstract class EncapsulatedPKIDataVerifierBase + implements QualifyingPropertyVerifier +{ + private final String propName; + + public EncapsulatedPKIDataVerifierBase(String propName) + { + this.propName = propName; + } + + public QualifyingProperty verify(BaseEncapsulatedPKIData propData, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + Collection rawCerts = propData.getData(); + CertificateFactory certFactory; + try + { + certFactory = CertificateFactory.getInstance("X509"); + } catch (CertificateException ex) + { + throw new EncapsulatedPKIDataVerificationException(ex, propName); + } + + List certificates = new ArrayList(); + + for (byte[] cert : rawCerts) + { + InputStream inStream = new ByteArrayInputStream(cert); + try + { + certificates.add((X509Certificate) certFactory.generateCertificate(inStream)); + } catch (CertificateException ex) + { + throw new EncapsulatedPKIDataVerificationException(ex, propName); + } + } + + return createProperty(certificates); + } + + public abstract QualifyingProperty createProperty(Collection certs); +} diff --git a/src/main/java/xades4j/verification/RevocationValuesVerificationException.java b/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerificationException.java similarity index 81% rename from src/main/java/xades4j/verification/RevocationValuesVerificationException.java rename to src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerificationException.java index 3a4afeab..c20a69cd 100644 --- a/src/main/java/xades4j/verification/RevocationValuesVerificationException.java +++ b/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerificationException.java @@ -16,14 +16,16 @@ */ package xades4j.verification; -public class RevocationValuesVerificationException extends +public class EncapsulatedPKIRevocationDataVerificationException extends InvalidPropertyException { private static final long serialVersionUID = 1L; + private final String propName; - public RevocationValuesVerificationException(Exception ex) + public EncapsulatedPKIRevocationDataVerificationException(Exception ex, String propName) { super(ex); + this.propName = propName; } @Override @@ -35,7 +37,7 @@ protected String getVerificationMessage() @Override public String getPropertyName() { - return "RevocationValues"; + return propName; } } diff --git a/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java b/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java new file mode 100644 index 00000000..faa229e5 --- /dev/null +++ b/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java @@ -0,0 +1,74 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.security.cert.CRLException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509CRL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import xades4j.properties.QualifyingProperty; +import xades4j.properties.data.BaseEncapsulatedPKIData; + +public abstract class EncapsulatedPKIRevocationDataVerifierBase + implements QualifyingPropertyVerifier +{ + private final String propName; + + public EncapsulatedPKIRevocationDataVerifierBase(String propName) + { + this.propName = propName; + } + + public QualifyingProperty verify(BaseEncapsulatedPKIData propData, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + Collection rawRevocationData = propData.getData(); + CertificateFactory certFactory; + try + { + certFactory = CertificateFactory.getInstance("X509"); + } catch (CertificateException ex) + { + throw new EncapsulatedPKIRevocationDataVerificationException(ex, propName); + } + + List crls = new ArrayList(); + + for (byte[] crl : rawRevocationData) + { + InputStream inStream = new ByteArrayInputStream(crl); + try + { + crls.add((X509CRL) certFactory.generateCRL(inStream)); + } catch (CRLException ex) + { + throw new EncapsulatedPKIRevocationDataVerificationException(ex, propName); + } + } + + return createProperty(crls); + } + + public abstract QualifyingProperty createProperty(Collection crls); +} diff --git a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java index 299a1fa2..d4214e96 100644 --- a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java @@ -18,6 +18,8 @@ import java.util.Collection; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; import xades4j.properties.data.CompleteCertificateRefsData; import xades4j.properties.data.CompleteRevocationRefsData; @@ -113,12 +115,24 @@ public void setCertificateValues(CertificateValuesData certificateValuesData) propsData.add(certificateValuesData); } + @Override + public void setAttrAuthoritiesCertValues(AttrAuthoritiesCertValuesData attrAuthoritiesCertValuesData) + { + propsData.add(attrAuthoritiesCertValuesData); + } + @Override public void setRevocationValues(RevocationValuesData revocationValuesData) { propsData.add(revocationValuesData); } + @Override + public void setAttributeRevocationValues(AttributeRevocationValuesData attrRevocValData) + { + propsData.add(attrRevocValData); + } + @Override public void addCommitmentType(CommitmentTypeData commitmentData) { diff --git a/src/main/java/xades4j/verification/RevocationValuesVerifier.java b/src/main/java/xades4j/verification/RevocationValuesVerifier.java index 7c34b17f..e3f61203 100644 --- a/src/main/java/xades4j/verification/RevocationValuesVerifier.java +++ b/src/main/java/xades4j/verification/RevocationValuesVerifier.java @@ -16,54 +16,31 @@ */ package xades4j.verification; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.security.cert.CRLException; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; import java.security.cert.X509CRL; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import xades4j.properties.QualifyingProperty; import xades4j.properties.RevocationValuesProperty; import xades4j.properties.data.RevocationValuesData; -public class RevocationValuesVerifier implements - QualifyingPropertyVerifier +import com.google.inject.Inject; + +/** + * + * @author Hubert Kario + * + */ +public class RevocationValuesVerifier extends EncapsulatedPKIRevocationDataVerifierBase { + @Inject + public RevocationValuesVerifier(String propName) + { + super(propName); + } @Override - public QualifyingProperty verify(RevocationValuesData propData, - QualifyingPropertyVerificationContext ctx) - throws InvalidPropertyException + public QualifyingProperty createProperty(Collection crls) { - Collection rawRevocationData = propData.getData(); - CertificateFactory certFactory; - try - { - certFactory = CertificateFactory.getInstance("X509"); - } catch (CertificateException ex) - { - throw new RevocationValuesVerificationException(ex); - } - - List crls = new ArrayList(); - - for (byte[] crl : rawRevocationData) - { - InputStream inStream = new ByteArrayInputStream(crl); - try - { - crls.add((X509CRL) certFactory.generateCRL(inStream)); - } catch (CRLException ex) - { - throw new RevocationValuesVerificationException(ex); - } - } - return new RevocationValuesProperty(crls); } - } diff --git a/src/main/java/xades4j/xml/marshalling/DefaultUnsignedPropertiesMarshaller.java b/src/main/java/xades4j/xml/marshalling/DefaultUnsignedPropertiesMarshaller.java index 77553d93..24663ed7 100644 --- a/src/main/java/xades4j/xml/marshalling/DefaultUnsignedPropertiesMarshaller.java +++ b/src/main/java/xades4j/xml/marshalling/DefaultUnsignedPropertiesMarshaller.java @@ -21,6 +21,8 @@ import org.w3c.dom.Node; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.ArchiveTimeStampData; +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; import xades4j.properties.data.CompleteCertificateRefsData; import xades4j.properties.data.CompleteRevocationRefsData; @@ -55,7 +57,9 @@ class DefaultUnsignedPropertiesMarshaller super.putConverter(CompleteRevocationRefsData.class, new ToXmlCompleteRevocRefsConverter()); super.putConverter(SigAndRefsTimeStampData.class, new ToXmlSigAndRefsTimeStampConverter(algorithmsParametersMarshallingProvider)); super.putConverter(CertificateValuesData.class, new ToXmlCertificateValuesConverter()); + super.putConverter(AttrAuthoritiesCertValuesData.class, new ToXmlAttrAuthoritiesCertValuesConverter()); super.putConverter(RevocationValuesData.class, new ToXmlRevocationValuesConverter()); + super.putConverter(AttributeRevocationValuesData.class, new ToXmlAttributeRevocationValuesConverter()); super.putConverter(ArchiveTimeStampData.class, new ToXmlArchiveTimeStampConverter(algorithmsParametersMarshallingProvider)); /* The CounterSignature property is marshalled directly using DOM because * it is easier that way (it is represented by a GenericDOMData instance). diff --git a/src/main/java/xades4j/xml/marshalling/ToXmlAttrAuthoritiesCertValuesConverter.java b/src/main/java/xades4j/xml/marshalling/ToXmlAttrAuthoritiesCertValuesConverter.java new file mode 100644 index 00000000..6219e60a --- /dev/null +++ b/src/main/java/xades4j/xml/marshalling/ToXmlAttrAuthoritiesCertValuesConverter.java @@ -0,0 +1,53 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.marshalling; + +import java.util.Collection; +import java.util.List; + +import org.w3c.dom.Document; + +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.properties.data.PropertyDataObject; +import xades4j.xml.bind.xades.XmlCertificateValuesType; +import xades4j.xml.bind.xades.XmlEncapsulatedPKIDataType; +import xades4j.xml.bind.xades.XmlUnsignedPropertiesType; + +public class ToXmlAttrAuthoritiesCertValuesConverter implements + UnsignedPropertyDataToXmlConverter +{ + + @Override + public void convertIntoObjectTree(PropertyDataObject propData, + XmlUnsignedPropertiesType xmlProps, Document doc) + { + Collection certValues = + ((AttrAuthoritiesCertValuesData)propData).getData(); + + XmlCertificateValuesType xmlCertValues = new XmlCertificateValuesType(); + List xmlCerts = xmlCertValues.getEncapsulatedX509CertificateOrOtherCertificate(); + + for (byte[] encodedCer : certValues) + { + XmlEncapsulatedPKIDataType xmlEncodedCert = new XmlEncapsulatedPKIDataType(); + xmlEncodedCert.setValue(encodedCer); + xmlCerts.add(xmlEncodedCert); + } + + xmlProps.getUnsignedSignatureProperties().setAttrAuthoritiesCertValues(xmlCertValues); + } +} diff --git a/src/main/java/xades4j/xml/marshalling/ToXmlAttributeRevocationValuesConverter.java b/src/main/java/xades4j/xml/marshalling/ToXmlAttributeRevocationValuesConverter.java new file mode 100644 index 00000000..5564dc1f --- /dev/null +++ b/src/main/java/xades4j/xml/marshalling/ToXmlAttributeRevocationValuesConverter.java @@ -0,0 +1,56 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.marshalling; + +import java.util.Collection; +import java.util.List; + +import org.w3c.dom.Document; + +import xades4j.properties.data.AttributeRevocationValuesData; +import xades4j.properties.data.PropertyDataObject; +import xades4j.xml.bind.xades.XmlCRLValuesType; +import xades4j.xml.bind.xades.XmlEncapsulatedPKIDataType; +import xades4j.xml.bind.xades.XmlRevocationValuesType; +import xades4j.xml.bind.xades.XmlUnsignedPropertiesType; + +public class ToXmlAttributeRevocationValuesConverter + implements UnsignedPropertyDataToXmlConverter +{ + @Override + public void convertIntoObjectTree(PropertyDataObject propData, + XmlUnsignedPropertiesType xmlProps, Document doc) + { + Collection crlValues = ((AttributeRevocationValuesData)propData).getData(); + + XmlRevocationValuesType xmlAttrRevocValues = new XmlRevocationValuesType(); + XmlCRLValuesType xmlCRLValues = new XmlCRLValuesType(); + xmlAttrRevocValues.setCRLValues(xmlCRLValues); + + List xmlCRLs = xmlCRLValues.getEncapsulatedCRLValue(); + + for (byte[] encodCrl : crlValues) + { + XmlEncapsulatedPKIDataType xmlEncodedCrl = new XmlEncapsulatedPKIDataType(); + xmlEncodedCrl.setValue(encodCrl); + xmlCRLs.add(xmlEncodedCrl); + } + + xmlProps.getUnsignedSignatureProperties() + .setAttributeRevocationValues(xmlAttrRevocValues); + } +} diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlAttrAuthoritiesCertValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlAttrAuthoritiesCertValuesConverter.java new file mode 100644 index 00000000..c0b41826 --- /dev/null +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlAttrAuthoritiesCertValuesConverter.java @@ -0,0 +1,57 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.unmarshalling; + +import java.util.List; + +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.xml.bind.xades.XmlAnyType; +import xades4j.xml.bind.xades.XmlCertificateValuesType; +import xades4j.xml.bind.xades.XmlEncapsulatedPKIDataType; +import xades4j.xml.bind.xades.XmlUnsignedSignaturePropertiesType; + +public class FromXmlAttrAuthoritiesCertValuesConverter implements + UnsignedSigPropFromXmlConv +{ + + @Override + public void convertFromObjectTree( + XmlUnsignedSignaturePropertiesType xmlProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { + XmlCertificateValuesType xmlCertificateValues = xmlProps.getAttrAuthoritiesCertValues(); + if (null == xmlCertificateValues) + return; + + AttrAuthoritiesCertValuesData attrAuthoritiesCertValuesData = + new AttrAuthoritiesCertValuesData(); + List values = xmlCertificateValues.getEncapsulatedX509CertificateOrOtherCertificate(); + for (Object item : values) + { + if (item instanceof XmlEncapsulatedPKIDataType) + { + XmlEncapsulatedPKIDataType cert = (XmlEncapsulatedPKIDataType) item; + attrAuthoritiesCertValuesData.addData(cert.getValue()); + } + if (item instanceof XmlAnyType) + throw new PropertyUnmarshalException("Property not supported", "OtherCertificate"); + } + + propertyDataCollector.setAttrAuthoritiesCertValues(attrAuthoritiesCertValuesData); + } +} diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlAttributeRevocationValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlAttributeRevocationValuesConverter.java new file mode 100644 index 00000000..c2ad0ca6 --- /dev/null +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlAttributeRevocationValuesConverter.java @@ -0,0 +1,59 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.unmarshalling; + +import java.util.List; + +import xades4j.properties.data.AttributeRevocationValuesData; +import xades4j.xml.bind.xades.XmlCRLValuesType; +import xades4j.xml.bind.xades.XmlEncapsulatedPKIDataType; +import xades4j.xml.bind.xades.XmlRevocationValuesType; +import xades4j.xml.bind.xades.XmlUnsignedSignaturePropertiesType; + +public class FromXmlAttributeRevocationValuesConverter + implements UnsignedSigPropFromXmlConv +{ + @Override + public void convertFromObjectTree( + XmlUnsignedSignaturePropertiesType xmlProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { + XmlRevocationValuesType xmlRevocationValues = xmlProps.getAttributeRevocationValues(); + if (null == xmlRevocationValues) + return; + + AttributeRevocationValuesData attrRevocationValuesData = + new AttributeRevocationValuesData(); + XmlCRLValuesType values = xmlRevocationValues.getCRLValues(); + List crls = values.getEncapsulatedCRLValue(); + for (XmlEncapsulatedPKIDataType crl : crls) + { + attrRevocationValuesData.addData(crl.getValue()); + } + + // handle unsupported data + if (xmlRevocationValues.getOCSPValues() != null) + throw new PropertyUnmarshalException("OCSP responses are unsupported", + "AttributeRevocationValues"); + if (xmlRevocationValues.getOtherValues() != null) + throw new PropertyUnmarshalException("Other (not CRL and not OCSP) " + + "certificate revocation values unsupported", "AttributeRevocationValues"); + + propertyDataCollector.setAttributeRevocationValues(attrRevocationValuesData); + } +} diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java index b15a1860..fadbfd82 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java @@ -26,7 +26,6 @@ public class FromXmlRevocationValuesConverter implements UnsignedSigPropFromXmlConv { - @Override public void convertFromObjectTree( XmlUnsignedSignaturePropertiesType xmlProps, @@ -55,5 +54,4 @@ public void convertFromObjectTree( propertyDataCollector.setRevocationValues(revocationValuesData); } - } diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java index 77f97020..ec87ebb4 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java @@ -33,8 +33,6 @@ public void convertFromObjectTree( if (!ObjectUtils.allNull( xmlProps.getAttributeCertificateRefs(), xmlProps.getAttributeRevocationRefs(), - xmlProps.getAttrAuthoritiesCertValues(), - xmlProps.getAttributeRevocationValues(), xmlProps.getAttributeCertificateRefs()) || !xmlProps.getRefsOnlyTimeStamp().isEmpty() || !xmlProps.getArchiveTimeStamp().isEmpty()) diff --git a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java index dc0a2302..4942c5a4 100644 --- a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java +++ b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java @@ -17,6 +17,8 @@ package xades4j.xml.unmarshalling; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; import xades4j.properties.data.RevocationValuesData; import xades4j.properties.data.SigAndRefsTimeStampData; @@ -83,4 +85,10 @@ public void addIndividualDataObjsTimeStamp( public void setCertificateValues(CertificateValuesData certificateValuesData); public void setRevocationValues(RevocationValuesData revocationValuesData); + + public void setAttrAuthoritiesCertValues( + AttrAuthoritiesCertValuesData attrAuthoritiesCertValuesData); + + public void setAttributeRevocationValues( + AttributeRevocationValuesData attrRevocValData); } diff --git a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java index 35635236..4bb5d9a7 100644 --- a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java +++ b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java @@ -39,6 +39,8 @@ class UnsignedSigPropsModule extends UnmarshallerModule Date: Wed, 31 Oct 2012 14:04:58 +0100 Subject: [PATCH 07/84] test creation of optional -X-L form properties Signed-off-by: Tiago Rossi --- src/test/java/xades4j/verification/XadesVerifierImplTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/java/xades4j/verification/XadesVerifierImplTest.java b/src/test/java/xades4j/verification/XadesVerifierImplTest.java index a1f2a95f..e4f0be62 100644 --- a/src/test/java/xades4j/verification/XadesVerifierImplTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierImplTest.java @@ -26,6 +26,8 @@ import org.w3c.dom.NodeList; import xades4j.production.XadesFormatExtenderProfile; import xades4j.production.XadesSignatureFormatExtender; +import xades4j.properties.AttrAuthoritiesCertValuesProperty; +import xades4j.properties.AttributeRevocationValuesProperty; import xades4j.properties.CertificateValuesProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.RevocationValuesProperty; @@ -219,6 +221,8 @@ public void testVerifyCEnrichXL() throws Exception assertPropElementPresent(signatureNode, SigAndRefsTimeStampProperty.PROP_NAME); assertPropElementPresent(signatureNode, CertificateValuesProperty.PROP_NAME); assertPropElementPresent(signatureNode, RevocationValuesProperty.PROP_NAME); + assertPropElementPresent(signatureNode, AttrAuthoritiesCertValuesProperty.PROP_NAME); + assertPropElementPresent(signatureNode, AttributeRevocationValuesProperty.PROP_NAME); outputDocument(doc, "document.verified.c.xl.xml"); } From f36834890ef62e6af3a49caf018cf917d0f2b15f Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 30 Oct 2012 13:12:50 +0100 Subject: [PATCH 08/84] add certificates and CRLs used in verification of TimeStamps to -X-L form Signed-off-by: Tiago Rossi --- .../providers/TimeStampVerificationProvider.java | 6 +++++- .../DefaultTimeStampVerificationProvider.java | 9 ++++++++- src/main/java/xades4j/utils/PropertiesUtils.java | 16 +++++++++++++++- .../QualifyingPropertyVerificationContext.java | 15 +++++++++++++++ .../verification/TimeStampVerifierBase.java | 2 +- .../verification/XAdESVerificationResult.java | 14 ++++++++++++++ .../xades4j/verification/XadesVerifierImpl.java | 5 ++++- ...DefaultTimeStampVerificationProviderTest.java | 3 ++- 8 files changed, 64 insertions(+), 6 deletions(-) diff --git a/src/main/java/xades4j/providers/TimeStampVerificationProvider.java b/src/main/java/xades4j/providers/TimeStampVerificationProvider.java index 247e246b..d74c8f1c 100644 --- a/src/main/java/xades4j/providers/TimeStampVerificationProvider.java +++ b/src/main/java/xades4j/providers/TimeStampVerificationProvider.java @@ -18,6 +18,8 @@ import java.util.Date; +import xades4j.verification.QualifyingPropertyVerificationContext; + /** * Provides verification of time-stamp tokens. This is used whenever a time-stamp * property needs to be verified. @@ -35,5 +37,7 @@ public interface TimeStampVerificationProvider */ public Date verifyToken( byte[] timeStampToken, - byte[] tsDigestInput) throws TimeStampTokenVerificationException; + byte[] tsDigestInput, + QualifyingPropertyVerificationContext ctx) + throws TimeStampTokenVerificationException; } diff --git a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java index 3cb45fef..ba5de309 100644 --- a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java +++ b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java @@ -52,6 +52,7 @@ import xades4j.providers.TimeStampTokenVerificationException; import xades4j.providers.TimeStampVerificationProvider; import xades4j.providers.ValidationData; +import xades4j.verification.QualifyingPropertyVerificationContext; /** * Default implementation of {@code TimeStampVerificationProvider}. It verifies @@ -102,7 +103,9 @@ public DefaultTimeStampVerificationProvider( } @Override - public Date verifyToken(byte[] timeStampToken, byte[] tsDigestInput) throws TimeStampTokenVerificationException + public Date verifyToken(byte[] timeStampToken, byte[] tsDigestInput, + QualifyingPropertyVerificationContext ctx) + throws TimeStampTokenVerificationException { TimeStampToken tsToken; try @@ -137,6 +140,10 @@ public Date verifyToken(byte[] timeStampToken, byte[] tsDigestInput) throws Time null == tsaCert ? null : Collections.singletonList(tsaCert)); tsaCert = vData.getCerts().get(0); + + // XXX should we really add validation data /before/ token validation? + if (ctx != null) + ctx.addAttributeValidationData(vData); } catch (CertificateException ex) { diff --git a/src/main/java/xades4j/utils/PropertiesUtils.java b/src/main/java/xades4j/utils/PropertiesUtils.java index d12d7b45..e49c9b36 100644 --- a/src/main/java/xades4j/utils/PropertiesUtils.java +++ b/src/main/java/xades4j/utils/PropertiesUtils.java @@ -16,11 +16,14 @@ */ package xades4j.utils; +import java.security.cert.X509CRL; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collection; import java.util.List; import xades4j.properties.ArchiveTimeStampProperty; +import xades4j.properties.AttrAuthoritiesCertValuesProperty; +import xades4j.properties.AttributeRevocationValuesProperty; import xades4j.properties.CertificateValuesProperty; import xades4j.properties.CompleteCertificateRefsProperty; import xades4j.properties.CompleteRevocationRefsProperty; @@ -79,12 +82,23 @@ public static void addXadesXProperties( public static void addXadesXLProperties( Collection usp, - ValidationData vData) + ValidationData vData, + Collection tstValData) { usp.add(new CertificateValuesProperty(vData.getCerts())); usp.add(new RevocationValuesProperty(vData.getCrls())); // TODO add AttrAuthoritiesCertValues // TODO add AttributeRevocationValues + Collection allTSACerts = new ArrayList(); + Collection allTSACRLs = new ArrayList(); + for (ValidationData valData : tstValData) + { + allTSACerts.addAll(valData.getCerts()); + allTSACRLs.addAll(valData.getCrls()); + } + usp.add(new AttrAuthoritiesCertValuesProperty(allTSACerts)); + + usp.add(new AttributeRevocationValuesProperty(allTSACRLs)); } public static void addXadesAProperties( diff --git a/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java b/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java index 40d1b2ae..06d94903 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java +++ b/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java @@ -19,6 +19,7 @@ import java.math.BigInteger; import java.security.cert.X509CRL; import java.security.cert.X509Certificate; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -36,6 +37,8 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; +import xades4j.providers.ValidationData; + /** * The context available during the verification of the qualifying properties. * @see QualifyingPropertyVerifier @@ -46,6 +49,7 @@ public class QualifyingPropertyVerificationContext private final XMLSignature signature; private final CertificationChainData certChainData; private final SignedObjectsData signedObjectsData; + private Collection attributeValidationData; QualifyingPropertyVerificationContext( XMLSignature signature, @@ -55,6 +59,17 @@ public class QualifyingPropertyVerificationContext this.signature = signature; this.certChainData = certChainData; this.signedObjectsData = signedObjectsData; + attributeValidationData = new ArrayList(); + } + + public Collection getAttributeValidationData() + { + return attributeValidationData; + } + + public void addAttributeValidationData(ValidationData validationData) + { + attributeValidationData.add(validationData); } public XMLSignature getSignature() diff --git a/src/main/java/xades4j/verification/TimeStampVerifierBase.java b/src/main/java/xades4j/verification/TimeStampVerifierBase.java index b1532f71..d0f9daca 100644 --- a/src/main/java/xades4j/verification/TimeStampVerifierBase.java +++ b/src/main/java/xades4j/verification/TimeStampVerifierBase.java @@ -68,7 +68,7 @@ public final QualifyingProperty verify( Date ts = null; for (byte[] tkn : tokens) { - ts = this.tsVerifier.verifyToken(tkn, data); + ts = this.tsVerifier.verifyToken(tkn, data, ctx); } // By convention all timestamp property types have a setTime(Date) method diff --git a/src/main/java/xades4j/verification/XAdESVerificationResult.java b/src/main/java/xades4j/verification/XAdESVerificationResult.java index 635dca5f..ab619eaf 100644 --- a/src/main/java/xades4j/verification/XAdESVerificationResult.java +++ b/src/main/java/xades4j/verification/XAdESVerificationResult.java @@ -17,6 +17,7 @@ package xades4j.verification; import java.security.cert.X509Certificate; +import java.util.ArrayList; import java.util.Collection; import org.apache.xml.security.signature.XMLSignature; import xades4j.properties.QualifyingProperties; @@ -48,11 +49,13 @@ public class XAdESVerificationResult /**/ private final DataGetter propertiesGetter; private final QualifyingProperties qualifyingProperties; + private final Collection attributeValidationData; XAdESVerificationResult( XAdESForm signatureForm, XMLSignature xmlSignature, ValidationData validationData, + Collection attributeValidationData, Collection properties, Collection signedDataObjects) { @@ -64,6 +67,8 @@ public class XAdESVerificationResult this.propertiesGetter = createPropsGetter(properties); this.qualifyingProperties = createQualifProps(); + + this.attributeValidationData = attributeValidationData; } private DataGetter createPropsGetter( @@ -174,4 +179,13 @@ public Collection getSignedDataObjects() { return signedDataObjects; } + + /** + * returns validation data (certs and CRLs used to verify time stamps + * @return + */ + public Collection getAttributeValidationData() + { + return attributeValidationData; + } } diff --git a/src/main/java/xades4j/verification/XadesVerifierImpl.java b/src/main/java/xades4j/verification/XadesVerifierImpl.java index 5f054071..bbb3a4ff 100644 --- a/src/main/java/xades4j/verification/XadesVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesVerifierImpl.java @@ -81,6 +81,7 @@ class XadesVerifierImpl implements XadesVerifier @Inject protected XadesVerifierImpl( CertificateValidationProvider certificateValidator, + CertificateValidationProvider timestampCertificateValidator, QualifyingPropertiesVerifier qualifyingPropertiesVerifier, QualifyingPropertiesUnmarshaller qualifPropsUnmarshaller, Set rawSigVerifiers, @@ -217,6 +218,7 @@ public XAdESVerificationResult verify(Element signatureElem, SignatureSpecificVe XAdESFormChecker.checkForm(props), signature, certValidationRes, + qPropsCtx.getAttributeValidationData(), props, referencesRes.dataObjsReferences); @@ -464,7 +466,8 @@ public void addProps( Collection usp, XAdESVerificationResult res) { - PropertiesUtils.addXadesXLProperties(usp, res.getValidationData()); + PropertiesUtils.addXadesXLProperties(usp, res.getValidationData(), + res.getAttributeValidationData()); PropertiesUtils.addXadesXProperties(usp); } }; diff --git a/src/test/java/xades4j/providers/impl/DefaultTimeStampVerificationProviderTest.java b/src/test/java/xades4j/providers/impl/DefaultTimeStampVerificationProviderTest.java index 46a88e15..fa585db9 100644 --- a/src/test/java/xades4j/providers/impl/DefaultTimeStampVerificationProviderTest.java +++ b/src/test/java/xades4j/providers/impl/DefaultTimeStampVerificationProviderTest.java @@ -20,6 +20,7 @@ import java.io.FileInputStream; import java.security.KeyStore; import org.junit.Test; + import xades4j.providers.TimeStampTokenDigestException; import xades4j.providers.TimeStampTokenVerificationException; import xades4j.utils.StreamUtils; @@ -89,6 +90,6 @@ private void doVerifyToken(byte[] tsDigestInput, byte[] tsToken) throws Exceptio certificateValidationProvider, new DefaultMessageDigestProvider()); - timeStampVerificationProvider.verifyToken(tsToken, tsDigestInput); + timeStampVerificationProvider.verifyToken(tsToken, tsDigestInput, null); } } From 177a5cecda145a520c1da2515de332698c47f08f Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 5 Nov 2012 13:46:17 +0100 Subject: [PATCH 09/84] separate certificate verifiers for TimeStamps and Signature Signed-off-by: Tiago Rossi --- .../TSACertificateValidationProvider.java | 34 ++ .../DefaultTimeStampVerificationProvider.java | 5 +- .../PKIXCertificateValidationProvider.java | 370 +-------------- ...PKIXCertificateValidationProviderBase.java | 436 ++++++++++++++++++ .../PKIXTSACertificateValidationProvider.java | 243 ++++++++++ .../XadesVerificationProfile.java | 33 ++ .../verification/XadesVerifierImpl.java | 1 - ...aultTimeStampVerificationProviderTest.java | 2 +- .../verification/OtherVerifierTests.java | 4 +- .../verification/VerifierTestBase.java | 23 +- .../verification/VerifyExternalSigsTest.java | 44 +- .../XadesVerificationProfileTest.java | 4 +- .../verification/XadesVerifierErrorsTest.java | 14 +- .../verification/XadesVerifierImplTest.java | 11 +- 14 files changed, 842 insertions(+), 382 deletions(-) create mode 100644 src/main/java/xades4j/providers/TSACertificateValidationProvider.java create mode 100644 src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java create mode 100644 src/main/java/xades4j/providers/impl/PKIXTSACertificateValidationProvider.java diff --git a/src/main/java/xades4j/providers/TSACertificateValidationProvider.java b/src/main/java/xades4j/providers/TSACertificateValidationProvider.java new file mode 100644 index 00000000..3de6988a --- /dev/null +++ b/src/main/java/xades4j/providers/TSACertificateValidationProvider.java @@ -0,0 +1,34 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario -QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.providers; + +/** + * {@link CertificateValidationProvider} made specifically for validating certificates + * used by Time Stamping Authorities. + *

+ * verify() method should gracefully handle certificates with time stamping extended + * critical key usage extension. + *

+ * interface made specifically to differentiate verifiers used for signature + * verification and used for attribute verification (TimeStamps) + * @author Hubert Kario + * + */ +public interface TSACertificateValidationProvider extends + CertificateValidationProvider +{ +} diff --git a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java index ba5de309..fe076f06 100644 --- a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java +++ b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java @@ -45,6 +45,7 @@ import xades4j.XAdES4jException; import xades4j.providers.CertificateValidationProvider; import xades4j.providers.MessageDigestEngineProvider; +import xades4j.providers.TSACertificateValidationProvider; import xades4j.providers.TimeStampTokenDigestException; import xades4j.providers.TimeStampTokenSignatureException; import xades4j.providers.TimeStampTokenStructureException; @@ -82,7 +83,7 @@ private static String uriForDigest(ASN1ObjectIdentifier digestalgOid) { return digestOidToUriMappings.get(digestalgOid); } - private final CertificateValidationProvider certificateValidationProvider; + private final TSACertificateValidationProvider certificateValidationProvider; private final MessageDigestEngineProvider messageDigestProvider; private final JcaSimpleSignerInfoVerifierBuilder signerInfoVerifierBuilder; private final JcaX509CertificateConverter x509CertificateConverter; @@ -90,7 +91,7 @@ private static String uriForDigest(ASN1ObjectIdentifier digestalgOid) @Inject public DefaultTimeStampVerificationProvider( - CertificateValidationProvider certificateValidationProvider, + TSACertificateValidationProvider certificateValidationProvider, MessageDigestEngineProvider messageDigestProvider) { this.certificateValidationProvider = certificateValidationProvider; diff --git a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProvider.java b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProvider.java index 55a06c8b..c0596daf 100644 --- a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProvider.java +++ b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProvider.java @@ -1,6 +1,6 @@ /* * XAdES4j - A Java library for generation and verification of XAdES signatures. - * Copyright (C) 2010 Luis Goncalves. + * Copyright (C) 2012 Hubert Kario - QBS. * * XAdES4j is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -16,62 +16,29 @@ */ package xades4j.providers.impl; -import java.security.InvalidAlgorithmParameterException; import java.security.KeyStore; -import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; -import java.security.PublicKey; -import java.security.cert.CertPathBuilder; -import java.security.cert.CertPathBuilderException; import java.security.cert.CertStore; -import java.security.cert.CertStoreException; -import java.security.cert.Certificate; -import java.security.cert.CollectionCertStoreParameters; import java.security.cert.PKIXBuilderParameters; -import java.security.cert.PKIXCertPathBuilderResult; -import java.security.cert.X509CRL; -import java.security.cert.X509CRLSelector; -import java.security.cert.X509CertSelector; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.security.auth.x500.X500Principal; -import xades4j.providers.CannotBuildCertificationPathException; -import xades4j.providers.CannotSelectCertificateException; -import xades4j.providers.CertificateValidationException; import xades4j.providers.CertificateValidationProvider; -import xades4j.providers.ValidationData; -import xades4j.verification.UnexpectedJCAException; /** - * Implementation of {@code CertificateValidationProvider} using a PKIX {@code CertPathBuilder}. + * Implementation of {@code CertificateValidationProvider} using a PKIX + * {@code CertPathBuilder}. *

* Since the Java's PKIX API doesn't allow to access the CRLs used in the certification * path validation, this is manually done. There has to be a CRL for each issuer * in the path which is valid at the moment of validation (signature and date). - * @author Luís + * @author Hubert Kario */ -public class PKIXCertificateValidationProvider implements CertificateValidationProvider +public class PKIXCertificateValidationProvider + extends PKIXCertificateValidationProviderBase + implements CertificateValidationProvider { private static final int DEFAULT_MAX_PATH_LENGTH = 6; - private final KeyStore trustAnchors; - private final boolean revocationEnabled; - private final int maxPathLength; - private CertStore[] intermCertsAndCrls; - private final CertPathBuilder certPathBuilder; - private final String signatureProvider; - /** * Initializes a new instance that uses the specified JCE providers for CertPathBuilder * and Signature. @@ -92,19 +59,11 @@ public PKIXCertificateValidationProvider( int maxPathLength, String certPathBuilderProvider, String signatureProvider, - CertStore... intermCertsAndCrls) throws NoSuchAlgorithmException, NoSuchProviderException + CertStore[] intermCertsAndCrls) + throws NoSuchAlgorithmException, NoSuchProviderException { - if (null == trustAnchors) - { - throw new NullPointerException("Trust anchors cannot be null"); - } - - this.trustAnchors = trustAnchors; - this.revocationEnabled = revocationEnabled; - this.maxPathLength = maxPathLength; - this.certPathBuilder = certPathBuilderProvider == null ? CertPathBuilder.getInstance("PKIX") : CertPathBuilder.getInstance("PKIX", certPathBuilderProvider); - this.signatureProvider = signatureProvider; - this.intermCertsAndCrls = intermCertsAndCrls; + super(trustAnchors, revocationEnabled, maxPathLength, certPathBuilderProvider, + signatureProvider, intermCertsAndCrls); } /** @@ -125,7 +84,8 @@ public PKIXCertificateValidationProvider( boolean revocationEnabled, String certPathBuilderProvider, String signatureProvider, - CertStore... intermCertsAndCrls) throws NoSuchAlgorithmException, NoSuchProviderException + CertStore... intermCertsAndCrls) + throws NoSuchAlgorithmException, NoSuchProviderException { this(trustAnchors, revocationEnabled, DEFAULT_MAX_PATH_LENGTH, certPathBuilderProvider, signatureProvider, intermCertsAndCrls); } @@ -215,308 +175,10 @@ public PKIXCertificateValidationProvider( } @Override - public ValidationData validate( - X509CertSelector certSelector, - Date validationDate, - Collection otherCerts) throws CertificateValidationException, UnexpectedJCAException + protected void addImplSpecificPKIXBuilderParams(PKIXBuilderParameters pkixbp) { - PKIXBuilderParameters builderParams; - try - { - builderParams = new PKIXBuilderParameters(trustAnchors, certSelector); - } catch (KeyStoreException ex) - { - throw new CannotBuildCertificationPathException(certSelector, "Trust anchors KeyStore is not initialized", ex); - } catch (InvalidAlgorithmParameterException ex) - { - throw new CannotBuildCertificationPathException(certSelector, "Trust anchors KeyStore has no trusted certificate entries", ex); - } - - PKIXCertPathBuilderResult builderRes; - try - { - // Certificates to be used to build the certification path. - // - The other certificates from the signature (e.g. from KeyInfo). - if (otherCerts != null) - { - CollectionCertStoreParameters ccsp = new CollectionCertStoreParameters(otherCerts); - CertStore othersCertStore = CertStore.getInstance("Collection", ccsp); - builderParams.addCertStore(othersCertStore); - } - // - The external certificates/CRLs. - for (int i = 0; i < intermCertsAndCrls.length; i++) - { - builderParams.addCertStore(intermCertsAndCrls[i]); - } - - builderParams.setRevocationEnabled(revocationEnabled); - builderParams.setMaxPathLength(maxPathLength); - builderParams.setDate(validationDate); - builderParams.setSigProvider(this.signatureProvider); - - builderRes = (PKIXCertPathBuilderResult) certPathBuilder.build(builderParams); - } - catch (CertPathBuilderException ex) - { - throw new CannotBuildCertificationPathException(certSelector, ex.getMessage(), ex); - } catch (InvalidAlgorithmParameterException ex) - { - // SHOULD NOT be thrown due to wrong type of parameters. - // Seems to be thrown when the CertSelector (in builderParams) criteria - // cannot be applied. - throw new CannotSelectCertificateException(certSelector, ex); - } catch (NoSuchAlgorithmException ex) - { - // SHOULD NOT be thrown. - throw new UnexpectedJCAException("No provider for Collection CertStore", ex); - } - - // The cert path returned by the builder ends in a certificate issued by - // the trust anchor. However, the complete path may be needed for property - // verification. - List certPath = (List) builderRes.getCertPath().getCertificates(); - // - Create a new list since the previous is immutable. - certPath = new ArrayList(certPath); - // - Add the trust anchor certificate. - certPath.add(builderRes.getTrustAnchor().getTrustedCert()); - - if (revocationEnabled) - { - return new ValidationData(certPath, getCRLsForCertPath(certPath, validationDate)); - } - return new ValidationData(certPath); - } - - private Collection getCRLsForCertPath( - List certPath, - Date validationDate) throws CertificateValidationException - { - // Map the issuers certificates in the chain. This is used to know the issuers - // and later to verify the signatures in the CRLs. - Map issuersCerts = new HashMap(certPath.size() - 1); - for (int i = 0; i < certPath.size() - 1; i++) - { - // The issuer of one certificate is the subject of the following one. - issuersCerts.put(certPath.get(i).getIssuerX500Principal(), certPath.get(i + 1)); - } - - // Select all the CRLs from the issuers involved in the certification path - // that are valid at the moment. - X509CRLSelector crlSelector = new X509CRLSelector(); - for (X500Principal issuer : issuersCerts.keySet()) - { - // - "The issuer distinguished name in the X509CRL must match at least - // one of the specified distinguished names." - crlSelector.addIssuer(issuer); - } - // - "The specified date must be equal to or later than the value of the - // thisUpdate component of the X509CRL and earlier than the value of the - // nextUpdate component." - crlSelector.setDateAndTime(validationDate); - - Set crls = new HashSet(); - try - { - // Get the CRLs on each CertStore. - for (int i = 0; i < intermCertsAndCrls.length; i++) - { - Collection storeCRLs = intermCertsAndCrls[i].getCRLs(crlSelector); - crls.addAll(Collections.checkedCollection(storeCRLs, X509CRL.class)); - - } - } catch (CertStoreException ex) - { - throw new CertificateValidationException(null, "Cannot get CRLs", ex); - } - - // Verify the CRLs' signatures. The issuers' certificates were validated - // as part of the cert path creation. - for (X509CRL crl : crls) - { - try - { - X509Certificate crlIssuerCert = issuersCerts.get(crl.getIssuerX500Principal()); - if (null == this.signatureProvider) - { - crl.verify(crlIssuerCert.getPublicKey()); - } - else - { - crl.verify(crlIssuerCert.getPublicKey(), this.signatureProvider); - } - } - catch (Exception ex) - { - throw new CertificateValidationException(null, "Invalid CRL signature from " + crl.getIssuerX500Principal().getName(), ex); - } - } - return crls; - } - - @Override - public void addCRLs(Collection crls, Date now) - { - Collection validCRLs = new ArrayList(); - - for(X509CRL crl : crls) - { - // check if it's not CRL from "future" - if (crl.getThisUpdate().getTime() > now.getTime()) - continue; - - // TODO check algorithms used in CRL - - X509CertSelector certSel = new X509CertSelector(); - certSel.setSubject(crl.getIssuerX500Principal()); - - PKIXBuilderParameters params; - try - { - params = new PKIXBuilderParameters(trustAnchors, certSel); - } catch (Exception e) - { - // parameters are invalid, ignore CRL - continue; - } - params.setDate(now); - params.setRevocationEnabled(false); - for (int i=0; i < intermCertsAndCrls.length; i++) - { - params.addCertStore(intermCertsAndCrls[i]); - } - - PKIXCertPathBuilderResult res; - try - { - res = (PKIXCertPathBuilderResult) this.certPathBuilder.build(params); - } catch (Exception ex) - { - // CRL is invalid, ignore - continue; - } - - List certs = new ArrayList(res.getCertPath().getCertificates()); - // TODO check algorithms used in this cert path - PublicKey crlSigningKey; - if (certs.size() != 0) - crlSigningKey = ((Certificate)certs.get(0)).getPublicKey(); - else - crlSigningKey = res.getTrustAnchor().getCAPublicKey(); - if (crlSigningKey == null) - crlSigningKey = res.getTrustAnchor().getTrustedCert().getPublicKey(); - - try - { - crl.verify(crlSigningKey); - } catch (Exception ex) - { - // invalid CRL, ignore - continue; - } - - validCRLs.add(crl); - } - - // don't create empty CertStores - if (validCRLs.size() == 0) - return; - - CollectionCertStoreParameters ccsp = new CollectionCertStoreParameters(validCRLs); - CertStore crlsCertStore; - try - { - crlsCertStore = CertStore.getInstance("Collection", ccsp); - } catch (Exception e) - { - throw new RuntimeException("General crypto failure", e); - } - - CertStore[] newIntermCertsAndCrls; - newIntermCertsAndCrls = Arrays.copyOf(intermCertsAndCrls, intermCertsAndCrls.length + 1); - newIntermCertsAndCrls[intermCertsAndCrls.length] = crlsCertStore; - - intermCertsAndCrls = newIntermCertsAndCrls; + // no implementation specific validators + return; } - @Override - public void addCertificates(Collection otherCerts, Date now) - { - Collection validCerts = new ArrayList(); - - /* - * To validate certificates we need to have all issuer certificates. - * Needed issuer certificates can be among otherCerts. - * - * To work around this problem, we include otherCerts in PKIXBuilderParameters - * but add them to intermCertsAndCrls only if they validate successfully. - */ - CollectionCertStoreParameters ccsp = new CollectionCertStoreParameters(otherCerts); - CertStore otherCertsCertStore; - try - { - otherCertsCertStore = CertStore.getInstance("Collection", ccsp); - } catch (Exception ex) - { - throw new RuntimeException("General crypto failure", ex); - } - - // find good certificates - for (X509Certificate cert : otherCerts) - { - // TODO check algorithms used in certificate creation - - // TODO iff certificate matches entry in TSL, add them to trustAnchors - - X509CertSelector certSel = new X509CertSelector(); - certSel.setCertificate(cert); - - PKIXBuilderParameters params; - try { - params = new PKIXBuilderParameters(trustAnchors, certSel); - } catch (Exception e) - { - // parameters are invalid, ignore certificate - continue; - } - params.setDate(now); - params.setRevocationEnabled(false); - for (int i=0; i < intermCertsAndCrls.length; i++) - { - params.addCertStore(intermCertsAndCrls[i]); - } - params.addCertStore(otherCertsCertStore); - - PKIXCertPathBuilderResult res; - try - { - res = (PKIXCertPathBuilderResult)this.certPathBuilder.build(params); - } catch (Exception ex) - { - // certificate or certificates invalid, ignore - continue; - } - - List certs = res.getCertPath().getCertificates(); - if (certs.size() == 0) // cert is a trustAnchor, we can ignore it - continue; - - validCerts.add(cert); - } - - ccsp = new CollectionCertStoreParameters(validCerts); - CertStore validCertCertStore; - try - { - validCertCertStore = CertStore.getInstance("Collection", ccsp); - } catch (Exception e) - { - throw new RuntimeException("General crypto failure", e); - } - - CertStore[] newIntermCertsAndCrls; - newIntermCertsAndCrls = Arrays.copyOf(intermCertsAndCrls, intermCertsAndCrls.length + 1); - newIntermCertsAndCrls[intermCertsAndCrls.length] = validCertCertStore; - - intermCertsAndCrls = newIntermCertsAndCrls; - } } diff --git a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java new file mode 100644 index 00000000..7e7504e5 --- /dev/null +++ b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java @@ -0,0 +1,436 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2010 Luis Goncalves. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.providers.impl; + +import java.security.InvalidAlgorithmParameterException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.PublicKey; +import java.security.cert.CertPathBuilder; +import java.security.cert.CertPathBuilderException; +import java.security.cert.CertStore; +import java.security.cert.CertStoreException; +import java.security.cert.Certificate; +import java.security.cert.CollectionCertStoreParameters; +import java.security.cert.PKIXBuilderParameters; +import java.security.cert.PKIXCertPathBuilderResult; +import java.security.cert.X509CRL; +import java.security.cert.X509CRLSelector; +import java.security.cert.X509CertSelector; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.security.auth.x500.X500Principal; + +import xades4j.providers.CannotBuildCertificationPathException; +import xades4j.providers.CannotSelectCertificateException; +import xades4j.providers.CertificateValidationException; +import xades4j.providers.ValidationData; +import xades4j.verification.UnexpectedJCAException; + +/** + * + * @author Luís + * @author Hubert Kario + * + */ +public abstract class PKIXCertificateValidationProviderBase +{ + private final KeyStore trustAnchors; + private final boolean revocationEnabled; + private final int maxPathLength; + private CertStore[] intermCertsAndCrls; + private final CertPathBuilder certPathBuilder; + private final String signatureProvider; + + /** + * Initializes a new instance that uses the specified JCE providers for CertPathBuilder + * and Signature. + * @param trustAnchors the keystore with the trust-anchors ({@code TrustedCertificateEntry}) + * @param revocationEnabled whether revocation is enabled + * @param maxPathLength the maximum length of the certification paths + * @param certPathBuilderProvider the CertPathBuilder provider + * @param signatureProvider the Signature provider + * @param intermCertsAndCrls a set of {@code CertStore}s that contain certificates to be + * used in the construction of the certification path. May contain CRLs to be used + * if revocation is enabled + * @see xades4j.utils.FileSystemDirectoryCertStore + * @throws NoSuchAlgorithmException if there is no provider for PKIX CertPathBuilder + */ + public PKIXCertificateValidationProviderBase( + KeyStore trustAnchors, + boolean revocationEnabled, + int maxPathLength, + String certPathBuilderProvider, + String signatureProvider, + CertStore... intermCertsAndCrls) + throws NoSuchAlgorithmException, NoSuchProviderException + { + if (null == trustAnchors) + { + throw new NullPointerException("Trust anchors cannot be null"); + } + + this.trustAnchors = trustAnchors; + this.revocationEnabled = revocationEnabled; + this.maxPathLength = maxPathLength; + this.certPathBuilder = + certPathBuilderProvider == null ? + CertPathBuilder.getInstance("PKIX") : + CertPathBuilder.getInstance("PKIX", certPathBuilderProvider); + this.signatureProvider = signatureProvider; + this.intermCertsAndCrls = intermCertsAndCrls; + } + + public ValidationData validate( + X509CertSelector certSelector, + Date validationDate, + Collection otherCerts) + throws CertificateValidationException, UnexpectedJCAException + { + PKIXBuilderParameters builderParams; + try + { + builderParams = new PKIXBuilderParameters(trustAnchors, certSelector); + } catch (KeyStoreException ex) + { + throw new CannotBuildCertificationPathException(certSelector, + "Trust anchors KeyStore is not initialized", ex); + } catch (InvalidAlgorithmParameterException ex) + { + throw new CannotBuildCertificationPathException(certSelector, + "Trust anchors KeyStore has no trusted certificate entries", ex); + } + + PKIXCertPathBuilderResult builderRes; + try + { + // Certificates to be used to build the certification path. + // - The other certificates from the signature (e.g. from KeyInfo). + if (otherCerts != null) + { + CollectionCertStoreParameters ccsp = + new CollectionCertStoreParameters(otherCerts); + CertStore othersCertStore = CertStore.getInstance("Collection", ccsp); + builderParams.addCertStore(othersCertStore); + } + // - The external certificates/CRLs. + for (int i = 0; i < intermCertsAndCrls.length; i++) + { + builderParams.addCertStore(intermCertsAndCrls[i]); + } + + builderParams.setRevocationEnabled(revocationEnabled); + builderParams.setMaxPathLength(maxPathLength); + builderParams.setDate(validationDate); + builderParams.setSigProvider(this.signatureProvider); + addImplSpecificPKIXBuilderParams(builderParams); + + builderRes = (PKIXCertPathBuilderResult) certPathBuilder.build(builderParams); + } + catch (CertPathBuilderException ex) + { + throw new CannotBuildCertificationPathException(certSelector, + ex.getMessage(), ex); + } catch (InvalidAlgorithmParameterException ex) + { + // SHOULD NOT be thrown due to wrong type of parameters. + // Seems to be thrown when the CertSelector (in builderParams) criteria + // cannot be applied. + throw new CannotSelectCertificateException(certSelector, ex); + } catch (NoSuchAlgorithmException ex) + { + // SHOULD NOT be thrown. + throw new UnexpectedJCAException("No provider for Collection CertStore", ex); + } + + // The cert path returned by the builder ends in a certificate issued by + // the trust anchor. However, the complete path may be needed for property + // verification. + @SuppressWarnings("unchecked") + List certPath = + (List) builderRes.getCertPath().getCertificates(); + // - Create a new list since the previous is immutable. + certPath = new ArrayList(certPath); + // - Add the trust anchor certificate. + certPath.add(builderRes.getTrustAnchor().getTrustedCert()); + + if (revocationEnabled) + { + return new ValidationData(certPath, + getCRLsForCertPath(certPath, validationDate)); + } + return new ValidationData(certPath); + } + + private Collection getCRLsForCertPath( + List certPath, + Date validationDate) throws CertificateValidationException + { + // Map the issuers certificates in the chain. This is used to know the issuers + // and later to verify the signatures in the CRLs. + Map issuersCerts = + new HashMap(certPath.size() - 1); + for (int i = 0; i < certPath.size() - 1; i++) + { + // The issuer of one certificate is the subject of the following one. + issuersCerts.put(certPath.get(i).getIssuerX500Principal(), certPath.get(i + 1)); + } + + // Select all the CRLs from the issuers involved in the certification path + // that are valid at the moment. + X509CRLSelector crlSelector = new X509CRLSelector(); + for (X500Principal issuer : issuersCerts.keySet()) + { + // - "The issuer distinguished name in the X509CRL must match at least + // one of the specified distinguished names." + crlSelector.addIssuer(issuer); + } + // - "The specified date must be equal to or later than the value of the + // thisUpdate component of the X509CRL and earlier than the value of the + // nextUpdate component." + crlSelector.setDateAndTime(validationDate); + + Set crls = new HashSet(); + try + { + // Get the CRLs on each CertStore. + for (int i = 0; i < intermCertsAndCrls.length; i++) + { + @SuppressWarnings("unchecked") + Collection storeCRLs = + (Collection) intermCertsAndCrls[i].getCRLs(crlSelector); + crls.addAll(Collections.checkedCollection(storeCRLs, X509CRL.class)); + } + } catch (CertStoreException ex) + { + throw new CertificateValidationException(null, "Cannot get CRLs", ex); + } + + // Verify the CRLs' signatures. The issuers' certificates were validated + // as part of the cert path creation. + for (X509CRL crl : crls) + { + try + { + X509Certificate crlIssuerCert = + issuersCerts.get(crl.getIssuerX500Principal()); + if (null == this.signatureProvider) + { + crl.verify(crlIssuerCert.getPublicKey()); + } + else + { + crl.verify(crlIssuerCert.getPublicKey(), this.signatureProvider); + } + } + catch (Exception ex) + { + throw new CertificateValidationException(null, + "Invalid CRL signature from " + + crl.getIssuerX500Principal().getName(), ex); + } + } + return crls; + } + + public void addCRLs(Collection crls, Date now) + { + Collection validCRLs = new ArrayList(); + + for(X509CRL crl : crls) + { + // check if it's not CRL from "future" + if (crl.getThisUpdate().getTime() > now.getTime()) + continue; + + // TODO check algorithms used in CRL + + X509CertSelector certSel = new X509CertSelector(); + certSel.setSubject(crl.getIssuerX500Principal()); + + PKIXBuilderParameters params; + try + { + params = new PKIXBuilderParameters(trustAnchors, certSel); + } catch (Exception e) + { + // parameters are invalid, ignore CRL + continue; + } + params.setDate(now); + params.setRevocationEnabled(false); + for (int i=0; i < intermCertsAndCrls.length; i++) + { + params.addCertStore(intermCertsAndCrls[i]); + } + addImplSpecificPKIXBuilderParams(params); + + PKIXCertPathBuilderResult res; + try + { + res = (PKIXCertPathBuilderResult) this.certPathBuilder.build(params); + } catch (Exception ex) + { + // CRL is invalid, ignore + continue; + } + + List certs = + new ArrayList(res.getCertPath().getCertificates()); + // TODO check algorithms used in this cert path + PublicKey crlSigningKey; + if (certs.size() != 0) + crlSigningKey = certs.get(0).getPublicKey(); + else + crlSigningKey = res.getTrustAnchor().getCAPublicKey(); + if (crlSigningKey == null) + crlSigningKey = res.getTrustAnchor().getTrustedCert().getPublicKey(); + + try + { + crl.verify(crlSigningKey); + } catch (Exception ex) + { + // invalid CRL, ignore + continue; + } + + validCRLs.add(crl); + } + + // don't create empty CertStores + if (validCRLs.size() == 0) + return; + + CollectionCertStoreParameters ccsp = new CollectionCertStoreParameters(validCRLs); + CertStore crlsCertStore; + try + { + crlsCertStore = CertStore.getInstance("Collection", ccsp); + } catch (Exception e) + { + throw new RuntimeException("General crypto failure", e); + } + + CertStore[] newIntermCertsAndCrls; + newIntermCertsAndCrls = Arrays.copyOf(intermCertsAndCrls, intermCertsAndCrls.length + 1); + newIntermCertsAndCrls[intermCertsAndCrls.length] = crlsCertStore; + + intermCertsAndCrls = newIntermCertsAndCrls; + } + + public void addCertificates(Collection otherCerts, Date now) + { + Collection validCerts = new ArrayList(); + + /* + * To validate certificates we need to have all issuer certificates. + * Needed issuer certificates can be among otherCerts. + * + * To work around this problem, we include otherCerts in PKIXBuilderParameters + * but add them to intermCertsAndCrls only if they validate successfully. + */ + CollectionCertStoreParameters ccsp = new CollectionCertStoreParameters(otherCerts); + CertStore otherCertsCertStore; + try + { + otherCertsCertStore = CertStore.getInstance("Collection", ccsp); + } catch (Exception ex) + { + throw new RuntimeException("General crypto failure", ex); + } + + // find good certificates + for (X509Certificate cert : otherCerts) + { + // TODO check algorithms used in certificate creation + + // TODO iff certificate matches entry in TSL, add them to trustAnchors + + X509CertSelector certSel = new X509CertSelector(); + certSel.setCertificate(cert); + + PKIXBuilderParameters params; + try { + params = new PKIXBuilderParameters(trustAnchors, certSel); + } catch (Exception e) + { + // parameters are invalid, ignore certificate + continue; + } + params.setDate(now); + params.setRevocationEnabled(false); + for (int i=0; i < intermCertsAndCrls.length; i++) + { + params.addCertStore(intermCertsAndCrls[i]); + } + params.addCertStore(otherCertsCertStore); + addImplSpecificPKIXBuilderParams(params); + + PKIXCertPathBuilderResult res; + try + { + res = (PKIXCertPathBuilderResult)this.certPathBuilder.build(params); + } catch (Exception ex) + { + // certificate or certificates invalid, ignore + continue; + } + + List certs = res.getCertPath().getCertificates(); + if (certs.size() == 0) // cert is a trustAnchor, we can ignore it + continue; + + validCerts.add(cert); + } + + ccsp = new CollectionCertStoreParameters(validCerts); + CertStore validCertCertStore; + try + { + validCertCertStore = CertStore.getInstance("Collection", ccsp); + } catch (Exception e) + { + throw new RuntimeException("General crypto failure", e); + } + + CertStore[] newIntermCertsAndCrls; + newIntermCertsAndCrls = Arrays.copyOf(intermCertsAndCrls, intermCertsAndCrls.length + 1); + newIntermCertsAndCrls[intermCertsAndCrls.length] = validCertCertStore; + + intermCertsAndCrls = newIntermCertsAndCrls; + } + + /** + * Add usage or implementation specific handlers to CertPathBuilderParameters + * @param pkixbp + */ + protected abstract void addImplSpecificPKIXBuilderParams(PKIXBuilderParameters pkixbp); +} diff --git a/src/main/java/xades4j/providers/impl/PKIXTSACertificateValidationProvider.java b/src/main/java/xades4j/providers/impl/PKIXTSACertificateValidationProvider.java new file mode 100644 index 00000000..2863ee81 --- /dev/null +++ b/src/main/java/xades4j/providers/impl/PKIXTSACertificateValidationProvider.java @@ -0,0 +1,243 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.providers.impl; + +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.cert.CertPathValidatorException; +import java.security.cert.CertStore; +import java.security.cert.Certificate; +import java.security.cert.CertificateParsingException; +import java.security.cert.PKIXBuilderParameters; +import java.security.cert.PKIXCertPathChecker; +import java.security.cert.X509Certificate; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import xades4j.providers.TSACertificateValidationProvider; + +/** + * @author Luís + * @author Hubert Kario + */ +public class PKIXTSACertificateValidationProvider + extends PKIXCertificateValidationProviderBase + implements TSACertificateValidationProvider +{ + private static final int DEFAULT_MAX_PATH_LENGTH = 6; + + /** + * Initializes a new instance that uses the specified JCE providers for CertPathBuilder + * and Signature. + * @param trustAnchors the keystore with the trust-anchors ({@code TrustedCertificateEntry}) + * @param revocationEnabled whether revocation is enabled + * @param maxPathLength the maximum length of the certification paths + * @param certPathBuilderProvider the CertPathBuilder provider + * @param signatureProvider the Signature provider + * @param intermCertsAndCrls a set of {@code CertStore}s that contain certificates to be + * used in the construction of the certification path. May contain CRLs to be used + * if revocation is enabled + * @see xades4j.utils.FileSystemDirectoryCertStore + * @throws NoSuchAlgorithmException if there is no provider for PKIX CertPathBuilder + */ + public PKIXTSACertificateValidationProvider(KeyStore trustAnchors, + boolean revocationEnabled, int maxPathLength, + String certPathBuilderProvider, String signatureProvider, + CertStore[] intermCertsAndCrls) throws NoSuchAlgorithmException, + NoSuchProviderException + { + super(trustAnchors, revocationEnabled, maxPathLength, certPathBuilderProvider, + signatureProvider, intermCertsAndCrls); + } + + /** + * Initializes a new instance that uses the specified JCE providers for CertPathBuilder + * and Signature. + * @param trustAnchors the keystore with the trust-anchors ({@code TrustedCertificateEntry}) + * @param revocationEnabled whether revocation is enabled + * @param certPathBuilderProvider the CertPathBuilder provider + * @param signatureProvider the Signature provider + * @param intermCertsAndCrls a set of {@code CertStore}s that contain certificates to be + * used in the construction of the certification path. May contain CRLs to be used + * if revocation is enabled + * @see xades4j.utils.FileSystemDirectoryCertStore + * @throws NoSuchAlgorithmException if there is no provider for PKIX CertPathBuilder + */ + public PKIXTSACertificateValidationProvider( + KeyStore trustAnchors, + boolean revocationEnabled, + String certPathBuilderProvider, + String signatureProvider, + CertStore... intermCertsAndCrls) throws NoSuchAlgorithmException, NoSuchProviderException + { + this(trustAnchors, revocationEnabled, DEFAULT_MAX_PATH_LENGTH, certPathBuilderProvider, signatureProvider, intermCertsAndCrls); + } + + /** + * Initializes a new instance that uses the specified JCE provider for both + * CertPathBuilder and Signature. + * @param trustAnchors the keystore with the trust-anchors ({@code TrustedCertificateEntry}) + * @param revocationEnabled whether revocation is enabled + * @param maxPathLength the maximum length of the certification paths + * @param jceProvider the CertPathBuilder and Signature provider + * @param intermCertsAndCrls a set of {@code CertStore}s that contain certificates to be + * used in the construction of the certification path. May contain CRLs to be used + * if revocation is enabled + * @see xades4j.utils.FileSystemDirectoryCertStore + * @throws NoSuchAlgorithmException if there is no provider for PKIX CertPathBuilder + */ + public PKIXTSACertificateValidationProvider( + KeyStore trustAnchors, + boolean revocationEnabled, + int maxPathLength, + String jceProvider, + CertStore... intermCertsAndCrls) throws NoSuchAlgorithmException, NoSuchProviderException + { + this(trustAnchors, revocationEnabled, maxPathLength, jceProvider, jceProvider, intermCertsAndCrls); + } + + /** + * Initializes a new instance that uses the specified JCE provider for both + * CertPathBuilder and Signature. + * @param trustAnchors the keystore with the trust-anchors ({@code TrustedCertificateEntry}) + * @param revocationEnabled whether revocation is enabled + * @param jceProvider the CertPathBuilder and Signature provider + * @param intermCertsAndCrls a set of {@code CertStore}s that contain certificates to be + * used in the construction of the certification path. May contain CRLs to be used + * if revocation is enabled + * @see xades4j.utils.FileSystemDirectoryCertStore + * @throws NoSuchAlgorithmException if there is no provider for PKIX CertPathBuilder + */ + public PKIXTSACertificateValidationProvider( + KeyStore trustAnchors, + boolean revocationEnabled, + String jceProvider, + CertStore... intermCertsAndCrls) throws NoSuchAlgorithmException, NoSuchProviderException + { + this(trustAnchors, revocationEnabled, DEFAULT_MAX_PATH_LENGTH, jceProvider, intermCertsAndCrls); + } + + /** + * Initializes a new instance without specifying the JCE providers for CertPathBuilder + * and Signature. + * @param trustAnchors the keystore with the trust-anchors ({@code TrustedCertificateEntry}) + * @param revocationEnabled whether revocation is enabled + * @param maxPathLength the maximum length of the certification paths + * @param intermCertsAndCrls a set of {@code CertStore}s that contain certificates to be + * used in the construction of the certification path. May contain CRLs to be used + * if revocation is enabled + * @see xades4j.utils.FileSystemDirectoryCertStore + * @throws NoSuchAlgorithmException if there is no provider for PKIX CertPathBuilder + */ + public PKIXTSACertificateValidationProvider( + KeyStore trustAnchors, + boolean revocationEnabled, + int maxPathLength, + CertStore... intermCertsAndCrls) throws NoSuchAlgorithmException, NoSuchProviderException + { + this(trustAnchors, revocationEnabled, maxPathLength, null, null, intermCertsAndCrls); + } + + /** + * Initializes a new instance without specifying the JCE providers for CertPathBuilder + * and Signature. + * @param trustAnchors the keystore with the trust-anchors ({@code TrustedCertificateEntry}) + * @param revocationEnabled whether revocation is enabled + * @param intermCertsAndCrls a set of {@code CertStore}s that contain certificates to be + * used in the construction of the certification path. May contain CRLs to be used + * if revocation is enabled + * @see xades4j.utils.FileSystemDirectoryCertStore + * @throws NoSuchAlgorithmException if there is no provider for PKIX CertPathBuilder + */ + public PKIXTSACertificateValidationProvider( + KeyStore trustAnchors, + boolean revocationEnabled, + CertStore... intermCertsAndCrls) throws NoSuchAlgorithmException, NoSuchProviderException + { + this(trustAnchors, revocationEnabled, DEFAULT_MAX_PATH_LENGTH, null, null, intermCertsAndCrls); + } + + @Override + protected void addImplSpecificPKIXBuilderParams(PKIXBuilderParameters pkixbp) + { + pkixbp.addCertPathChecker(new TimeStampingPropertyChecker()); + } + + private class TimeStampingPropertyChecker extends PKIXCertPathChecker + { + private static final String EXTENDED_KEY_USAGE_OID = "2.5.29.37"; + private static final String TIMESTAMPING_OID = "1.3.6.1.5.5.7.3.8"; + + @Override + public void check(Certificate cert, + Collection unresolvedCritExts) + throws CertPathValidatorException + { + X509Certificate myCert = (X509Certificate) cert; + + // can't do anything meaningful + if (!unresolvedCritExts.contains(EXTENDED_KEY_USAGE_OID)) + return; + + List extendedKeyUses; + try + { + extendedKeyUses = myCert.getExtendedKeyUsage(); + } catch (CertificateParsingException e) + { + e.printStackTrace(); + throw new CertPathValidatorException("Can't parse certificate!"); + } + + for (int i = 0; i < extendedKeyUses.size(); i++) + { + if (extendedKeyUses.get(i).equals(TIMESTAMPING_OID)) + { + unresolvedCritExts.remove(EXTENDED_KEY_USAGE_OID); + return; + } + } + throw new CertPathValidatorException( + "Certificate does not allow for Time Stamping"); + } + + @Override + public Set getSupportedExtensions() + { + Set supportedExtensions = new HashSet(); + supportedExtensions.add(TIMESTAMPING_OID); + return supportedExtensions; + } + + @Override + public void init(boolean forward) throws CertPathValidatorException + { + if (forward) + throw new CertPathValidatorException( + "Forward Cert Path checking not supported!"); + } + + @Override + public boolean isForwardCheckingSupported() + { + return false; + } + } +} diff --git a/src/main/java/xades4j/verification/XadesVerificationProfile.java b/src/main/java/xades4j/verification/XadesVerificationProfile.java index cddf2598..6f013f74 100644 --- a/src/main/java/xades4j/verification/XadesVerificationProfile.java +++ b/src/main/java/xades4j/verification/XadesVerificationProfile.java @@ -25,6 +25,7 @@ import xades4j.providers.CertificateValidationProvider; import xades4j.providers.MessageDigestEngineProvider; import xades4j.providers.SignaturePolicyDocumentProvider; +import xades4j.providers.TSACertificateValidationProvider; import xades4j.providers.TimeStampVerificationProvider; import xades4j.utils.UtilsBindingsModule; import xades4j.xml.marshalling.algorithms.AlgorithmParametersBindingsModule; @@ -73,6 +74,11 @@ private XadesVerificationProfile() withBinding(XadesVerifier.class, XadesVerifierImpl.class); } + /** + * Certificate validation profile to be used only with signatures lacking time stamps + * + * @param certificateValidationProvider + */ public XadesVerificationProfile( CertificateValidationProvider certificateValidationProvider) { @@ -80,6 +86,24 @@ public XadesVerificationProfile( withBinding(CertificateValidationProvider.class, certificateValidationProvider); } + /** + * Certificate validation profile that can be used to validate both signature and + * time stamps in Advanced Electronic Signatures. + * + * @param certificateValidationProvider validation data and provider to be used for + * validation Signature only + * @param tsaCertificateValidationProvider validation data and provider to be used for + * validation of time stamps in signature + */ + public XadesVerificationProfile( + CertificateValidationProvider certificateValidationProvider, + TSACertificateValidationProvider tsaCertificateValidationProvider) + { + this(); + withBinding(CertificateValidationProvider.class, certificateValidationProvider); + withBinding(TSACertificateValidationProvider.class, tsaCertificateValidationProvider); + } + public XadesVerificationProfile( Class certificateValidationProviderClass) { @@ -87,6 +111,15 @@ public XadesVerificationProfile( withBinding(CertificateValidationProvider.class, certificateValidationProviderClass); } + public XadesVerificationProfile( + Class certificateValidationProviderClass, + Class tsaCertificateValProvClass) + { + this(); + withBinding(CertificateValidationProvider.class, certificateValidationProviderClass); + withBinding(TSACertificateValidationProvider.class, tsaCertificateValProvClass); + } + /***/ /** * Adds a type dependency mapping to the profile. This is typically done from an diff --git a/src/main/java/xades4j/verification/XadesVerifierImpl.java b/src/main/java/xades4j/verification/XadesVerifierImpl.java index bbb3a4ff..4861e715 100644 --- a/src/main/java/xades4j/verification/XadesVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesVerifierImpl.java @@ -81,7 +81,6 @@ class XadesVerifierImpl implements XadesVerifier @Inject protected XadesVerifierImpl( CertificateValidationProvider certificateValidator, - CertificateValidationProvider timestampCertificateValidator, QualifyingPropertiesVerifier qualifyingPropertiesVerifier, QualifyingPropertiesUnmarshaller qualifPropsUnmarshaller, Set rawSigVerifiers, diff --git a/src/test/java/xades4j/providers/impl/DefaultTimeStampVerificationProviderTest.java b/src/test/java/xades4j/providers/impl/DefaultTimeStampVerificationProviderTest.java index fa585db9..f7503396 100644 --- a/src/test/java/xades4j/providers/impl/DefaultTimeStampVerificationProviderTest.java +++ b/src/test/java/xades4j/providers/impl/DefaultTimeStampVerificationProviderTest.java @@ -84,7 +84,7 @@ private byte[] getTestToken() throws Exception private void doVerifyToken(byte[] tsDigestInput, byte[] tsToken) throws Exception { KeyStore ks = createAndLoadJKSKeyStore("gva/trustAnchor", "password"); - PKIXCertificateValidationProvider certificateValidationProvider = new PKIXCertificateValidationProvider(ks, false); + PKIXTSACertificateValidationProvider certificateValidationProvider = new PKIXTSACertificateValidationProvider(ks, false); DefaultTimeStampVerificationProvider timeStampVerificationProvider = new DefaultTimeStampVerificationProvider( certificateValidationProvider, diff --git a/src/test/java/xades4j/verification/OtherVerifierTests.java b/src/test/java/xades4j/verification/OtherVerifierTests.java index 2e755462..85ff9f94 100644 --- a/src/test/java/xades4j/verification/OtherVerifierTests.java +++ b/src/test/java/xades4j/verification/OtherVerifierTests.java @@ -53,7 +53,9 @@ public class OtherVerifierTests extends VerifierTestBase @Before public void initialize() { - mySigsVerificationProfile = new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs); + mySigsVerificationProfile = + new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs, + VerifierTestBase.tsaValidationProviderMySigs); } @Test(expected = UnsupportedOperationException.class) diff --git a/src/test/java/xades4j/verification/VerifierTestBase.java b/src/test/java/xades4j/verification/VerifierTestBase.java index 98a5009a..136f8d2b 100644 --- a/src/test/java/xades4j/verification/VerifierTestBase.java +++ b/src/test/java/xades4j/verification/VerifierTestBase.java @@ -27,8 +27,10 @@ import org.w3c.dom.Element; import xades4j.properties.ObjectIdentifier; import xades4j.providers.CertificateValidationProvider; +import xades4j.providers.TSACertificateValidationProvider; import xades4j.utils.FileSystemDirectoryCertStore; import xades4j.providers.impl.PKIXCertificateValidationProvider; +import xades4j.providers.impl.PKIXTSACertificateValidationProvider; import xades4j.providers.SignaturePolicyDocumentProvider; import xades4j.utils.SignatureServicesTestBase; @@ -40,7 +42,9 @@ public class VerifierTestBase extends SignatureServicesTestBase { static SignaturePolicyDocumentProvider policyDocumentFinder; public static CertificateValidationProvider validationProviderMySigs; + public static TSACertificateValidationProvider tsaValidationProviderMySigs; public static CertificateValidationProvider validationProviderNist; + public static TSACertificateValidationProvider tsaValidationProviderNist; public static CertificateValidationProvider validationProviderPtCc; static @@ -61,14 +65,26 @@ public InputStream getSignaturePolicyDocumentStream( // signatures without revocation data. FileSystemDirectoryCertStore certStore = createDirectoryCertStore("my"); KeyStore ks = createAndLoadJKSKeyStore("my/myStore", "mystorepass"); - validationProviderMySigs = new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); + validationProviderMySigs = new PKIXCertificateValidationProvider(ks, + false, + certStore.getStore()); + tsaValidationProviderMySigs = new PKIXTSACertificateValidationProvider(ks, + false, + certStore.getStore()); // Validation provider with certificates/CRL from "csrc.nist" folder // and TSA CRL. Used for signatures with complete validation data. certStore = createDirectoryCertStore("csrc.nist"); FileSystemDirectoryCertStore gvaCRLStore = createDirectoryCertStore("gva"); ks = createAndLoadJKSKeyStore("csrc.nist/trustAnchor", "password"); - validationProviderNist = new PKIXCertificateValidationProvider(ks, true, certStore.getStore(), gvaCRLStore.getStore()); + validationProviderNist = new PKIXCertificateValidationProvider(ks, + true, + certStore.getStore(), + gvaCRLStore.getStore()); + tsaValidationProviderNist = new PKIXTSACertificateValidationProvider(ks, + true, + certStore.getStore(), + gvaCRLStore.getStore()); // Validation provider for "pt" folder. Used for signatures produced // with the PT citizen card. @@ -90,7 +106,8 @@ public InputStream getSignaturePolicyDocumentStream( protected static XAdESForm verifySignature(String sigFileName) throws Exception { - return verifySignature(sigFileName, new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs)); + return verifySignature(sigFileName, new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs, + VerifierTestBase.tsaValidationProviderMySigs)); } protected static XAdESForm verifySignature( diff --git a/src/test/java/xades4j/verification/VerifyExternalSigsTest.java b/src/test/java/xades4j/verification/VerifyExternalSigsTest.java index 8f587375..5bba5c10 100644 --- a/src/test/java/xades4j/verification/VerifyExternalSigsTest.java +++ b/src/test/java/xades4j/verification/VerifyExternalSigsTest.java @@ -22,7 +22,9 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import xades4j.providers.CertificateValidationProvider; +import xades4j.providers.TSACertificateValidationProvider; import xades4j.providers.impl.PKIXCertificateValidationProvider; +import xades4j.providers.impl.PKIXTSACertificateValidationProvider; import xades4j.utils.DOMHelper; import xades4j.utils.FileSystemDirectoryCertStore; @@ -41,16 +43,22 @@ public void testVerifyPTTSL() throws Exception FileSystemDirectoryCertStore certStore = createDirectoryCertStore("tsl/pt"); KeyStore ks = KeyStore.getInstance("Windows-ROOT"); ks.load(null); - PKIXCertificateValidationProvider cvp = new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); - verifyTSL("TSL_PT.xml", cvp); + PKIXCertificateValidationProvider cvp = + new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); + PKIXTSACertificateValidationProvider tcvp = + new PKIXTSACertificateValidationProvider(ks, false, certStore.getStore()); + verifyTSL("TSL_PT.xml", cvp, tcvp); } @Test public void testVerifyBETSL() throws Exception { KeyStore ks = createAndLoadJKSKeyStore("tsl/be/beStore", "bestorepass"); - PKIXCertificateValidationProvider cvp = new PKIXCertificateValidationProvider(ks, false); - verifyTSL("TSL_BE.xml", cvp); + PKIXCertificateValidationProvider cvp = + new PKIXCertificateValidationProvider(ks, false); + PKIXTSACertificateValidationProvider tcvp = + new PKIXTSACertificateValidationProvider(ks, false); + verifyTSL("TSL_BE.xml", cvp, tcvp); } @Test @@ -58,8 +66,11 @@ public void testVerifyESTSL() throws Exception { KeyStore ks = createAndLoadJKSKeyStore("tsl/es/esStore", "esstorepass"); FileSystemDirectoryCertStore certStore = createDirectoryCertStore("tsl/es"); - PKIXCertificateValidationProvider cvp = new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); - verifyTSL("TSL_ES.xml", cvp); + PKIXCertificateValidationProvider cvp = + new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); + PKIXTSACertificateValidationProvider tcvp = + new PKIXTSACertificateValidationProvider(ks, false, certStore.getStore()); + verifyTSL("TSL_ES.xml", cvp, tcvp); } @Test @@ -67,8 +78,11 @@ public void testVerifyITTSL() throws Exception { KeyStore ks = createAndLoadJKSKeyStore("tsl/it/itStore", "itstorepass"); FileSystemDirectoryCertStore certStore = createDirectoryCertStore("tsl/it"); - PKIXCertificateValidationProvider cvp = new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); - verifyTSL("TSL_IT.xml", cvp); + PKIXCertificateValidationProvider cvp = + new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); + PKIXTSACertificateValidationProvider tcvp = + new PKIXTSACertificateValidationProvider(ks, false, certStore.getStore()); + verifyTSL("TSL_IT.xml", cvp, tcvp); } // @Test @@ -102,9 +116,11 @@ public void testVerifyITTSL() throws Exception // }; // verifyTSL("TSL_SK.xml", new XadesVerificationProfile(cvp).withPolicyDocumentProvider(spp)); // } - private void verifyTSL(String fileName, CertificateValidationProvider cvp) throws Exception + private void verifyTSL(String fileName, + CertificateValidationProvider cvp, + TSACertificateValidationProvider tcvp) throws Exception { - verifyTSL(fileName, new XadesVerificationProfile(cvp)); + verifyTSL(fileName, new XadesVerificationProfile(cvp, tcvp)); } private void verifyTSL(String fileName, XadesVerificationProfile p) throws Exception @@ -123,7 +139,10 @@ public void testVerifyPetition() throws Exception FileSystemDirectoryCertStore certStore = createDirectoryCertStore("petition"); KeyStore ks = createAndLoadJKSKeyStore("petition/signitStore", "signitstorepass"); - PKIXCertificateValidationProvider cvp = new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); + PKIXCertificateValidationProvider cvp = + new PKIXCertificateValidationProvider(ks, false, certStore.getStore()); + PKIXTSACertificateValidationProvider tcvp = + new PKIXTSACertificateValidationProvider(ks, false, certStore.getStore()); Document doc = getDocument("external/Petition_1285054657304.xml"); @@ -131,7 +150,8 @@ public void testVerifyPetition() throws Exception Element petitionElem = DOMHelper.getFirstChildElement(doc.getDocumentElement()); petitionElem.setIdAttribute("id", true); - XAdESForm f = verifySignature(getSigElement(doc), new XadesVerificationProfile(cvp)); + XAdESForm f = verifySignature(getSigElement(doc), + new XadesVerificationProfile(cvp, tcvp)); assertEquals(f, XAdESForm.T); } } diff --git a/src/test/java/xades4j/verification/XadesVerificationProfileTest.java b/src/test/java/xades4j/verification/XadesVerificationProfileTest.java index 7be842fa..af7992d5 100644 --- a/src/test/java/xades4j/verification/XadesVerificationProfileTest.java +++ b/src/test/java/xades4j/verification/XadesVerificationProfileTest.java @@ -30,7 +30,9 @@ public class XadesVerificationProfileTest public void testGetVerifier() throws XadesProfileResolutionException { System.out.println("getVerifier"); - XadesVerificationProfile instance = new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs); + XadesVerificationProfile instance = + new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs, + VerifierTestBase.tsaValidationProviderMySigs); XadesVerifier result = instance.newVerifier(); assertNotNull(result); } diff --git a/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java b/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java index bbdd81f1..72edae52 100644 --- a/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java @@ -35,8 +35,12 @@ public class XadesVerifierErrorsTest extends VerifierTestBase @Before public void initialize() { - mySigsVerificationProfile = new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs); - nistVerificationProfile = new XadesVerificationProfile(VerifierTestBase.validationProviderNist); + mySigsVerificationProfile = new XadesVerificationProfile( + VerifierTestBase.validationProviderMySigs, + VerifierTestBase.tsaValidationProviderMySigs); + nistVerificationProfile = new XadesVerificationProfile( + VerifierTestBase.validationProviderNist, + VerifierTestBase.tsaValidationProviderMySigs); } @Test(expected = QualifyingPropertiesIncorporationException.class) @@ -55,7 +59,8 @@ public void testErrVerifySignedPropsIncorpNoRefType() throws Exception fail("Test written for Windows-ROOT certificate repository"); verifyBadSignature("document.signed.bes.signedpropsrefnotype.xml", - new XadesVerificationProfile(validationProviderPtCc)); + new XadesVerificationProfile(validationProviderPtCc, + tsaValidationProviderMySigs)); } @Test(expected = InvalidXAdESFormException.class) @@ -72,7 +77,8 @@ public void testErrVerifyNoSignCert() throws Exception KeyStore ks = createAndLoadJKSKeyStore("tsl/be/beStore", "bestorepass"); PKIXCertificateValidationProvider cvp = new PKIXCertificateValidationProvider(ks, false); - verifyBadSignature("TSL_BE.nocert.xml", new XadesVerificationProfile(cvp)); + verifyBadSignature("TSL_BE.nocert.xml", new XadesVerificationProfile(cvp, + tsaValidationProviderMySigs)); } @Test(expected = ReferenceValueException.class) diff --git a/src/test/java/xades4j/verification/XadesVerifierImplTest.java b/src/test/java/xades4j/verification/XadesVerifierImplTest.java index e4f0be62..95a51e76 100644 --- a/src/test/java/xades4j/verification/XadesVerifierImplTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierImplTest.java @@ -45,8 +45,12 @@ public class XadesVerifierImplTest extends VerifierTestBase @Before public void initialize() { - verificationProfile = new XadesVerificationProfile(VerifierTestBase.validationProviderMySigs); - nistVerificationProfile = new XadesVerificationProfile(VerifierTestBase.validationProviderNist); + verificationProfile = new XadesVerificationProfile( + VerifierTestBase.validationProviderMySigs, + VerifierTestBase.tsaValidationProviderMySigs); + nistVerificationProfile = new XadesVerificationProfile( + VerifierTestBase.validationProviderNist, + VerifierTestBase.tsaValidationProviderNist); } @Test @@ -155,7 +159,8 @@ public void testVerifyTPTCC() throws Exception fail("Test written for Windows-ROOT certificate repository"); XAdESForm f = verifySignature("document.signed.t.bes.ptcc.xml", - new XadesVerificationProfile(validationProviderPtCc)); + new XadesVerificationProfile(validationProviderPtCc, + tsaValidationProviderMySigs)); assertEquals(XAdESForm.T, f); } From 1db7b94a2150caa9ac4bdcca746810e7244e185e Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Wed, 24 Oct 2012 19:43:46 +0200 Subject: [PATCH 10/84] backend for generating our own certificates for tests Signed-off-by: Tiago Rossi --- .../java/xades4j/verification/FullCert.java | 511 ++++++++++++++++++ 1 file changed, 511 insertions(+) create mode 100644 src/test/java/xades4j/verification/FullCert.java diff --git a/src/test/java/xades4j/verification/FullCert.java b/src/test/java/xades4j/verification/FullCert.java new file mode 100644 index 00000000..e5bc2284 --- /dev/null +++ b/src/test/java/xades4j/verification/FullCert.java @@ -0,0 +1,511 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.math.BigInteger; +import java.security.InvalidParameterException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.PrivateKey; +import java.security.cert.X509CRL; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.naming.directory.InvalidAttributesException; +import javax.security.auth.x500.X500Principal; + +import org.bouncycastle.asn1.DERNull; +import org.bouncycastle.asn1.DERSequence; +import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; +import org.bouncycastle.asn1.pkcs.RSAPublicKey; +import org.bouncycastle.asn1.x500.X500Name; +import org.bouncycastle.asn1.x509.AlgorithmIdentifier; +import org.bouncycastle.asn1.x509.AuthorityKeyIdentifier; +import org.bouncycastle.asn1.x509.BasicConstraints; +import org.bouncycastle.asn1.x509.CRLNumber; +import org.bouncycastle.asn1.x509.ExtendedKeyUsage; +import org.bouncycastle.asn1.x509.KeyPurposeId; +import org.bouncycastle.asn1.x509.KeyUsage; +import org.bouncycastle.asn1.x509.SubjectKeyIdentifier; +import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; +import org.bouncycastle.asn1.x509.X509Extension; +import org.bouncycastle.cert.X509CRLHolder; +import org.bouncycastle.cert.X509v2CRLBuilder; +import org.bouncycastle.cert.X509v3CertificateBuilder; +import org.bouncycastle.cert.jcajce.JcaX509CRLConverter; +import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; +import org.bouncycastle.operator.ContentSigner; +import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; + +/** + * Class wrapping Certificate and PrivateKey in a easy-to-use package, oriented to testing + * + * @author Hubert Kario + * + */ +public class FullCert +{ + private X509Certificate certificate; + private PrivateKey privateKey; + + public X509Certificate getCertificate() + { + return certificate; + } + + public PrivateKey getPrivateKey() + { + return privateKey; + } + + /** + * @param algorithm key generation algorithm: RSA, DSA, ECDSA (currently only RSA is + * supported) + * @param keySize size of generated keys, for example 2048 for RSA and 521 for ECDSA + * @param distinguishedName DN of the new certificate + * @param notBefore time from which certificate is valid + * @param notAfter time after which certificate is not valid + * @param serialNumber this should be an unique serial number of the certificate + * @param sigAlgorithm name of signature algorithm (SHA1withDSA, SHA256withRSA, etc.) + * @param isCA should the new certificate be for a Certificate Authority + * @param keyUsage valid key uses (bitwise OR on values from {@link KeyUsage} + * @param extendedAttrCritical are extended key usage attributes critical + * @param extendedAttr list of extended attributes, if null then no extended key + * attributes will be added to certificate + * @param signer certificate that has to sign new certificate, can be null, + * then it will create a self-signed certificate + * @return ready to use FullCert (certificate + private key) + * @throws Exception on any error + */ + private static FullCert signCert( + String algorithm, + int keySize, + String distinguishedName, + Date notBefore, + Date notAfter, + BigInteger serialNumber, + String sigAlgorithm, + boolean isCA, + int keyUsage, + boolean extendedAttrCritical, + KeyPurposeId[] extendedAttr, + FullCert signer) throws Exception + { + if (!algorithm.equalsIgnoreCase("RSA")) + throw new InvalidAttributesException("Only RSA keys supported for the moment"); + + // prepare parameters + X500Principal subjectName = new X500Principal(distinguishedName); + // generate key pair + KeyPairGenerator kpg = KeyPairGenerator.getInstance(algorithm, "BC"); + kpg.initialize(keySize); + KeyPair keyPair = kpg.generateKeyPair(); + // extract public key as RSA public key + java.security.interfaces.RSAPublicKey rsaPublicKey = + (java.security.interfaces.RSAPublicKey) keyPair.getPublic(); + java.security.interfaces.RSAPublicKey caRSAPublicKey; + if (signer != null) + { + caRSAPublicKey = + (java.security.interfaces.RSAPublicKey) signer.certificate.getPublicKey(); + } else { + caRSAPublicKey = + (java.security.interfaces.RSAPublicKey) keyPair.getPublic(); + } + + // set basic information + X509v3CertificateBuilder certBuilder; + if (signer != null) + { + certBuilder = new JcaX509v3CertificateBuilder( + signer.certificate.getSubjectX500Principal(), + serialNumber, + notBefore, + notAfter, + subjectName, + keyPair.getPublic()); + } else { + certBuilder = new JcaX509v3CertificateBuilder( + subjectName, + serialNumber, + notBefore, + notAfter, + subjectName, + keyPair.getPublic()); + } + // used for creating extensions in certificate, depends on algorithm (RSA, DSA, + // ECDSA) + SubjectPublicKeyInfo subjectKeyInfo = + new SubjectPublicKeyInfo( + new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, + DERNull.INSTANCE), + new RSAPublicKey(rsaPublicKey.getModulus(), + rsaPublicKey.getPublicExponent())); + SubjectPublicKeyInfo issuerKeyInfo = + new SubjectPublicKeyInfo( + new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, + DERNull.INSTANCE), + new RSAPublicKey(caRSAPublicKey.getModulus(), + caRSAPublicKey.getPublicExponent())); + + /* + * Additional constraints are defaults from EJBCA + */ + certBuilder.addExtension(X509Extension.subjectKeyIdentifier, + false, /* extension should always be non critical */ + new SubjectKeyIdentifier(subjectKeyInfo)); + + certBuilder.addExtension(X509Extension.basicConstraints, + true, /* extension is critical */ + new BasicConstraints(isCA)); + + certBuilder.addExtension(X509Extension.authorityKeyIdentifier, + false, /* extension should always be non critical */ + new AuthorityKeyIdentifier(issuerKeyInfo)); + + certBuilder.addExtension(X509Extension.keyUsage, + true, /* is critical */ + new KeyUsage(keyUsage)); + + if (extendedAttr != null) + { + certBuilder.addExtension(X509Extension.extendedKeyUsage, + extendedAttrCritical, + new ExtendedKeyUsage(new DERSequence(extendedAttr))); + } + + // signature generator + ContentSigner sigGen; + if (signer != null) + { + sigGen = new JcaContentSignerBuilder(sigAlgorithm) + .setProvider("BC").build(signer.privateKey); + } else { + sigGen = new JcaContentSignerBuilder(sigAlgorithm) + .setProvider("BC").build(keyPair.getPrivate()); + } + + // export private key and signed certificate + FullCert cert = new FullCert(); + cert.privateKey = keyPair.getPrivate(); + cert.certificate = new JcaX509CertificateConverter() + .setProvider("BC").getCertificate(certBuilder.build(sigGen)); + + return cert; + } + + /** + * Generates Certificate with extensions useful for CA with serial number set at 1 + * + * @param algorithm key generation algorithm: RSA, DSA, ECDSA, etc. + * (currently only RSA is supported) + * @param keySize size of generated keys, for example 2048 for RSA and 521 for ECDSA + * @param distinguishedName DN of the CA + * @param notBefore time from which certificate is valid + * @param notAfter time after which certificate is not valid + * @param sigAlgorithm name of signature algorithm (SHAwithDSA, SHA256withRSA, etc.) + * @return Certificate together with private key + * @throws Exception on any error + */ + public static FullCert getCACert( + String algorithm, + int keySize, + String distinguishedName, + Date notBefore, + Date notAfter, + String sigAlgorithm) throws Exception + { + BigInteger serialNumber = new BigInteger("1"); + boolean isCA = true; + int keyUsage = KeyUsage.digitalSignature | KeyUsage.keyCertSign + | KeyUsage.cRLSign; + boolean extendedAttrCritical = false; + KeyPurposeId extendedAttr[] = null; + FullCert signer = null; + + return signCert(algorithm, + keySize, + distinguishedName, + notBefore, + notAfter, + serialNumber , + sigAlgorithm, + isCA, + keyUsage, + extendedAttrCritical, + extendedAttr, + signer); + } + + /** + * Uses current certificate as CA cert to create new user certificate with sane + * default key usages and extended key usages. Does not set distribution points for + * CRLs or OCSP + *

+ * Does not perform any sanity checks + * @param algorithm key generation algorithm: RSA, DSA, ECDSA + * (currently only RSA is supported) + * @param keySize size of generated keys, for example 2048 for RSA and 521 for ECDSA + * @param distinguishedName DN of the user + * @param notBefore time from which certificate is valid + * @param notAfter time after which certificate is not valid + * @param serialNumber this should be an unique serial number of the certificate + * @param sigAlgorithm name of signature algorithm (SHAwithDSA, SHA256withRSA, etc.) + * @return Certificate together with private key + * @throws Exception on any error + */ + public FullCert createUserCert( + String algorithm, + int keySize, + String distinguishedName, + Date notBefore, + Date notAfter, + BigInteger serialNumber, + String sigAlgorithm) throws Exception + { + boolean isCA = false; + int keyUsage = KeyUsage.digitalSignature | KeyUsage.keyEncipherment + | KeyUsage.dataEncipherment; + boolean extendedAttrCritical = false; + KeyPurposeId[] extendedAttr = new KeyPurposeId[3]; + extendedAttr[0] = KeyPurposeId.id_kp_clientAuth; + extendedAttr[1] = KeyPurposeId.id_kp_codeSigning; + extendedAttr[2] = KeyPurposeId.id_kp_emailProtection; + + return signCert(algorithm, + keySize, + distinguishedName, + notBefore, + notAfter, + serialNumber, + sigAlgorithm, + isCA, + keyUsage, + extendedAttrCritical, + extendedAttr, + this); + } + + /** + * Uses current certificate as CA cert to create new Time Stamping Authority (TSA) + * certificate with default key usages and extended key usages typical for a TSA. + * Does not set distribution points for CRLs or OCSP. + *

+ * Does not perform any sanity checks. Sets Extended Key Usage to critical. + * @param algorithm key generation algorithm: RSA, DSA, ECDSA + * (currently only RSA is supported) + * @param keySize size of generated keys, for example 2048 for RSA and 521 for ECDSA + * @param distinguishedName DN of the user + * @param notBefore time from which certificate is valid + * @param notAfter time after which certificate is not valid + * @param serialNumber this should be an unique serial number of the certificate + * @param sigAlgorithm name of signature algorithm (SHAwithDSA, SHA256withRSA, etc.) + * @return Certificate together with private key + * @throws Exception on any error + */ + public FullCert createTSACert( + String algorithm, + int keySize, + String distinguishedName, + Date notBefore, + Date notAfter, + BigInteger serialNumber, + String sigAlgorithm) throws Exception + { + boolean isCA = false; + int keyUsage = KeyUsage.digitalSignature | KeyUsage.nonRepudiation + | KeyUsage.keyEncipherment | KeyUsage.dataEncipherment; + boolean extendedAttrCritical = true; + KeyPurposeId[] extendedAttr = new KeyPurposeId[1]; + extendedAttr[0] = KeyPurposeId.id_kp_timeStamping; + + return signCert(algorithm, + keySize, + distinguishedName, + notBefore, + notAfter, + serialNumber, + sigAlgorithm, + isCA, + keyUsage, + extendedAttrCritical, + extendedAttr, + this); + } + + /** + * Uses current certificate as CA cert to create new sub CA certificate with sane + * default key usages. Does not set distribution points for + * CRLs or OCSP + *

+ * Does not perform any sanity checks + * @param algorithm key generation algorithm: RSA, DSA, ECDSA + * (currently only RSA is supported) + * @param keySize size of generated keys, for example 2048 for RSA and 521 for ECDSA + * @param distinguishedName DN of the user + * @param notBefore time from which certificate is valid + * @param notAfter time after which certificate is not valid + * @param serialNumber this should be an unique serial number of the certificate + * @param sigAlgorithm name of signature algorithm (SHAwithDSA, SHA256withRSA, etc.) + * @return Certificate together with private key + * @throws Exception on any error + */ + public FullCert createSubCACert( + String algorithm, + int keySize, + String distinguishedName, + Date notBefore, + Date notAfter, + BigInteger serialNumber, + String sigAlgorithm) throws Exception + { + + boolean isCA = true; + int keyUsage = KeyUsage.digitalSignature | KeyUsage.keyEncipherment + | KeyUsage.dataEncipherment; + boolean extendedAttrCritical = false; + KeyPurposeId[] extendedAttr = null; + + return signCert(algorithm, + keySize, + distinguishedName, + notBefore, + notAfter, + serialNumber, + sigAlgorithm, + isCA, + keyUsage, + extendedAttrCritical, + extendedAttr , + this); + } + + /** + * Class containing entries for conversion to CRL + * + * @author Hubert Kario + * + */ + public class CRLEntries + { + private List serialNumber; + private List revocationDate; + private List revocationReason; + + public CRLEntries() + { + serialNumber = new ArrayList(); + revocationDate = new ArrayList(); + revocationReason = new ArrayList(); + } + + public CRLEntries(CRLEntries old) + { + this.serialNumber = new ArrayList(old.serialNumber); + this.revocationDate = new ArrayList(old.revocationDate); + this.revocationReason = new ArrayList(old.revocationReason); + } + + public void addEntry(BigInteger serialNumber, Date revocationDate, + int revocationReason) + { + if (serialNumber == null || revocationDate == null) + throw new InvalidParameterException("Parameters can't be null"); + if (revocationReason < 0) + throw new InvalidParameterException("Revocation reason must be positive"); + + this.serialNumber.add(serialNumber); + this.revocationDate.add(revocationDate); + this.revocationReason.add(revocationReason); + } + + public int size() + { + return serialNumber.size(); + } + + public BigInteger getSerialNumber(int index) + { + return serialNumber.get(index); + } + + public Date getRevocaDate(int index) + { + return revocationDate.get(index); + } + + public int getRevocationReason(int index) + { + return revocationReason.get(index); + } + } + + /** + * Create new certificate revocation list using this certificate as CA + * @param sigAlgorithm CRL signature algorithm (for example SHA256withRSA) + * @param thisUpdate date when this CRL has been created + * @param nextUpdate when new CRL should have been created + * @param serial Serial number of the CRL + * @param entries list of revoked certificates + * @return + */ + public X509CRL createCRL(String sigAlgorithm, + Date thisUpdate, Date nextUpdate, BigInteger serial, CRLEntries entries) + throws Exception + { + java.security.interfaces.RSAPublicKey caRSAPublicKey = + (java.security.interfaces.RSAPublicKey) certificate.getPublicKey(); + + SubjectPublicKeyInfo issuerKeyInfo = + new SubjectPublicKeyInfo( + new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, + DERNull.INSTANCE), + new RSAPublicKey(caRSAPublicKey.getModulus(), + caRSAPublicKey.getPublicExponent())); + + X500Name issuer = new X500Name(this.certificate.getSubjectDN().toString()); + X509v2CRLBuilder crlBuilder = new X509v2CRLBuilder(issuer, thisUpdate); + + crlBuilder.setNextUpdate(nextUpdate); + + for (int i = 0; i < entries.size(); i++) + { + crlBuilder.addCRLEntry( + entries.getSerialNumber(i), + entries.getRevocaDate(i), + entries.getRevocationReason(i)); + } + + crlBuilder.addExtension(X509Extension.authorityKeyIdentifier, + false, /* not critical */ + new AuthorityKeyIdentifier(issuerKeyInfo)); + + crlBuilder.addExtension(X509Extension.cRLNumber, + false, /* not critical */ + new CRLNumber(serial)); + + // signature generator (use CA key) + ContentSigner sigGen = new JcaContentSignerBuilder(sigAlgorithm) + .setProvider("BC").build(this.privateKey); + + X509CRLHolder crlHolder = crlBuilder.build(sigGen); + return new JcaX509CRLConverter().setProvider("BC").getCRL(crlHolder); + } +} From 0210c81f3f5451a38ea7ac415625d82c02774031 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 6 Nov 2012 12:37:13 +0100 Subject: [PATCH 11/84] test XAdES-X-L form with minimal trust anchors XAdES-X-L form should contain all the data needed to verify both the Attributes (TimeStamps) and Signature, the only data needed are the CAs that validate the CRLs and leaf certificates (user and TSA) uses minimal validity periods (certificate loose their validity as soon as they're not needed) and minimum of verification anchors (during validaton only one leaf certificate is valid at a time) Signed-off-by: Tiago Rossi --- .../verification/XadesHybridVerifierImpl.java | 55 + .../verification/AgedTimeStampTest.java | 945 ++++++++++++++++++ .../SurrogateTimeStampTokenProvider.java | 225 +++++ 3 files changed, 1225 insertions(+) create mode 100644 src/main/java/xades4j/verification/XadesHybridVerifierImpl.java create mode 100644 src/test/java/xades4j/verification/AgedTimeStampTest.java create mode 100644 src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java new file mode 100644 index 00000000..522082d1 --- /dev/null +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -0,0 +1,55 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.util.Date; + +import org.w3c.dom.Element; + +import xades4j.XAdES4jException; +import xades4j.production.XadesSignatureFormatExtender; + +public class XadesHybridVerifierImpl implements XadesVerifier +{ + @Override + public XAdESVerificationResult verify(Element signatureElem, + SignatureSpecificVerificationOptions verificationOptions) + throws XAdES4jException + { + // TODO Auto-generated method stub + return null; + } + + @Override + public XAdESVerificationResult verify(Element signatureElem, + SignatureSpecificVerificationOptions verificationOptions, + XadesSignatureFormatExtender formatExtender, XAdESForm finalForm) + throws XAdES4jException + { + // TODO Auto-generated method stub + return null; + } + + // used only for tests + protected XAdESVerificationResult verify(Element signatureNode, Object object, + XadesSignatureFormatExtender formExt, XAdESForm c, Date date) + { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java new file mode 100644 index 00000000..fcc3a0b4 --- /dev/null +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -0,0 +1,945 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import static org.junit.Assert.assertEquals; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.math.BigInteger; +import java.security.InvalidAlgorithmParameterException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.Security; +import java.security.KeyStore.TrustedCertificateEntry; +import java.security.cert.CRLException; +import java.security.cert.CertStore; +import java.security.cert.CertStoreParameters; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; +import java.security.cert.CollectionCertStoreParameters; +import java.security.cert.X509CRL; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.apache.xml.security.utils.Constants; +import org.bouncycastle.asn1.x509.CRLReason; +import org.bouncycastle.cert.jcajce.JcaCertStore; +import org.bouncycastle.util.Store; +import org.junit.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.SAXException; + +import xades4j.XAdES4jException; +import xades4j.production.Enveloped; +import xades4j.production.XadesFormatExtenderProfile; +import xades4j.production.XadesSignatureFormatExtender; +import xades4j.production.XadesSigningProfile; +import xades4j.production.XadesTSigningProfile; +import xades4j.providers.CannotBuildCertificationPathException; +import xades4j.providers.CertificateValidationProvider; +import xades4j.providers.KeyingDataProvider; +import xades4j.providers.TSACertificateValidationProvider; +import xades4j.providers.impl.DirectKeyingDataProvider; +import xades4j.providers.impl.PKIXCertificateValidationProvider; +import xades4j.providers.impl.PKIXTSACertificateValidationProvider; +import xades4j.utils.DOMHelper; +import xades4j.utils.XadesProfileResolutionException; +import xades4j.verification.FullCert.CRLEntries; + +/** + * Extensive tests of signer and verifiers with special emphasis on testing time stamp + * related corner cases. + * + * @author Hubert Kario + * + */ +public class AgedTimeStampTest +{ + private static final CertStore emptyCertStore; + /* + * first test uses only XAdES-T signatures, Signature is from one CA and TimeStamp is + * signed by TSA from another CA, CRLs are generated on demand in tests + */ + private static FullCert test01_T_userCaCert; + private static FullCert test01_T_tsaCaCert; + private static FullCert test01_T_userCert; + private static FullCert test01_T_tsaCert; + private static X509CRL test01_T_tsaCRL_1; + private static X509CRL test01_T_userCRL_2; + private static X509CRL test01_T_tsaCRL_2; + private static Store test01_T_userCaStore; + private static KeyStore test01_T_userTrustAnchors; + private static KeyStore test01_T_tsaTrustAnchors; + + /** + * cryptographic data for signature creation + */ + private static KeyingDataProvider test01_keyingDataProviderNow; + /** + * cryptographic data from 30min ago for validation of certificates + */ + private static CertificateValidationProvider test01_userCertValidationDataProviderPast30m; + /** + * validation data provider that has revocation information from TSA from 30min ago + */ + private static TSACertificateValidationProvider test01_tsaValidationDataProviderPast30m; + /** + * validation data provider that has current revocation information + */ + private static CertificateValidationProvider test01_userCertValidationDataProviderNow; + /** + * validation data provider that has current revocation information for TSA + */ + private static TSACertificateValidationProvider test01_tsaValidationDataProviderNow; + + /* + * data for XAdES-X (SigAndRefsTimeStamp) tests + */ + private static FullCert test02_X_userCaCert; + private static FullCert test02_X_userCert; + private static FullCert test02_X_tsaCaCert; + private static FullCert test02_X_tsa1Cert; + private static FullCert test02_X_tsa2Cert; + private static X509CRL test02_X_tsaCRL_1; + private static X509CRL test02_X_tsaCRL_2; + //private static X509CRL test02_X_tsaCRL_3; + private static Store test02_X_userCaStore; + private static KeyStore test02_X_userTrustAnchors; + private static KeyStore test02_X_tsaTrustAnchors; + + private static KeyingDataProvider test02_keyingDataproviderNow; + private static CertificateValidationProvider test02_userCertValidationDataProviderXCreation; + private static TSACertificateValidationProvider test02_tsaCertValidationDataProviderXCreation; + private static TSACertificateValidationProvider test02_tsaCertValidationDataProviderNow; + private static CertificateValidationProvider test02_userCertMinimalValidationDataProvider; + private static TSACertificateValidationProvider test02_tsaCertMinimalValidationDataProvider; + + private static final long ONE_HOUR_IN_MS = 60 * 60 * 1000; + static + { + try { + + Date now = new Date(); + Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); + System.out.println("AgedTimeStampTest start, current time is " + now); + + CertStoreParameters emptyParams = new CollectionCertStoreParameters(); + emptyCertStore = CertStore.getInstance("Collection", emptyParams ); + + /* ****************************************************************************** + * + * Create cryptographic data for XAdES-T tests + * + * *****************************************************************************/ + createXadesTCerts(now); + + /* ****************************************************************************** + * + * Create certs and CRLs for XAdES-X tests + * + * *****************************************************************************/ + + createXadesXCerts(now); + + } catch (Exception ex) + { + throw new RuntimeException("static initialization failed", ex); + } + } + + private static void createXadesTCerts(Date now) throws Exception, + CertificateEncodingException, IOException, CRLException, + KeyStoreException, NoSuchAlgorithmException, CertificateException, + InvalidAlgorithmParameterException, NoSuchProviderException + { + X509CRL crl; + test01_T_userCaCert = FullCert.getCACert("RSA", 1024, "CN=XAdES4j Testing CA", + new Date(now.getTime() - ONE_HOUR_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS), + "SHA256withRSA"); /* cert will have serial number: 1 */ + saveCertificate("ca.cer", test01_T_userCaCert.getCertificate()); + System.out.println("CA validity from " + + test01_T_userCaCert.getCertificate().getNotBefore() + + " to " + test01_T_userCaCert.getCertificate().getNotAfter()); + + test01_T_tsaCaCert = FullCert.getCACert("RSA", 1024, "CN=XAdES4j TSA Testing CA", + new Date(now.getTime() - ONE_HOUR_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS), + "SHA256withRSA"); /* cert will have serial number: 1 */ + saveCertificate("tsaCA.cer", test01_T_userCaCert.getCertificate()); + System.out.println("TSA CA validity from " + + test01_T_userCaCert.getCertificate().getNotBefore() + + " to " + test01_T_userCaCert.getCertificate().getNotAfter()); + + test01_T_userCert = test01_T_userCaCert.createUserCert("RSA", 1024, + "CN=User Certificate", + new Date(now.getTime() - ONE_HOUR_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS/2), + new BigInteger("2"), "SHA256withRSA"); + saveCertificate("user.cer", test01_T_userCert.getCertificate()); + System.out.println("user validity from " + + test01_T_userCert.getCertificate().getNotBefore() + + " to " + test01_T_userCert.getCertificate().getNotAfter()); + + test01_T_tsaCert = test01_T_tsaCaCert.createTSACert("RSA", 1024, + "CN=XAdES4j Testing TSA", + new Date(now.getTime() - ONE_HOUR_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS/2), + new BigInteger("3"), "SHA256withRSA"); + saveCertificate("tsa.cer", test01_T_tsaCert.getCertificate()); + System.out.println("TSA validity from " + + test01_T_tsaCert.getCertificate().getNotBefore() + + " to " + test01_T_tsaCert.getCertificate().getNotAfter()); + + List certList = new ArrayList(); + certList.add(test01_T_userCaCert.getCertificate()); + test01_T_userCaStore = new JcaCertStore(certList); + + CRLEntries entries = test01_T_userCaCert.new CRLEntries(); + // add fictional entry + entries.addEntry(new BigInteger("134"), new Date(), CRLReason.keyCompromise); + + crl = test01_T_userCaCert.createCRL("SHA256withRSA", + new Date(now.getTime() - ONE_HOUR_IN_MS/2), + new Date(now.getTime() + ONE_HOUR_IN_MS/4), + new BigInteger("2"), + entries); + saveCRL("ca.crl", crl); + + test01_T_tsaCRL_1 = test01_T_tsaCaCert.createCRL("SHA256withRSA", + new Date(now.getTime() - ONE_HOUR_IN_MS/2), + new Date(now.getTime() + ONE_HOUR_IN_MS/4), + new BigInteger("2"), + entries); + saveCRL("tsaCA.crl", test01_T_tsaCRL_1); + + test01_T_userCRL_2 = test01_T_userCaCert.createCRL("SHA256withRSA", + new Date(now.getTime() - ONE_HOUR_IN_MS/60), + new Date(now.getTime() + ONE_HOUR_IN_MS/3), + new BigInteger("3"), + entries); + saveCRL("ca-3.crl", test01_T_userCRL_2); + + test01_T_tsaCRL_2 = test01_T_tsaCaCert.createCRL("SHA256withRSA", + new Date(now.getTime() - ONE_HOUR_IN_MS/60), + new Date(now.getTime() + ONE_HOUR_IN_MS/3), + new BigInteger("3"), + entries); + saveCRL("tsaCA-3.crl", test01_T_tsaCRL_2); + + test01_keyingDataProviderNow = + new DirectKeyingDataProvider(test01_T_userCert.getCertificate(), + test01_T_userCert.getPrivateKey()); + + /* + * Create validation data providers for past + */ + // create current trust anchors + test01_T_userTrustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + test01_T_userTrustAnchors.load(null); + TrustedCertificateEntry ca = + new TrustedCertificateEntry(test01_T_userCaCert.getCertificate()); + test01_T_userTrustAnchors.setEntry("ca", ca, null); + // create store with additional certificates and CRLs + Collection content = new ArrayList(); + content.add(crl); + CertStore intermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + // create validation provider with revocation information from 30m ago + test01_userCertValidationDataProviderPast30m = + new PKIXCertificateValidationProvider(test01_T_userTrustAnchors, + true, intermCertsAndCrls); + + // create current trust anchors + test01_T_tsaTrustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + test01_T_tsaTrustAnchors.load(null); + TrustedCertificateEntry tsaCA = + new TrustedCertificateEntry(test01_T_tsaCaCert.getCertificate()); + test01_T_tsaTrustAnchors.setEntry("ca", tsaCA, null); + // create store with additional certificates and CRLs + content = new ArrayList(); + content.add(test01_T_tsaCRL_1); + content.add(test01_T_tsaCert.getCertificate()); // tsa cert is not added to token + intermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + // create validation provider with revocation information from 30m ago + test01_tsaValidationDataProviderPast30m = new PKIXTSACertificateValidationProvider( + test01_T_tsaTrustAnchors, true, intermCertsAndCrls); + + /* + * create validation data providers for now + */ + // create store with additional certificates and CRLs + content = new ArrayList(); + content.add(test01_T_userCRL_2); + intermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + // create validation provider with revocation information from now + test01_userCertValidationDataProviderNow = + new PKIXCertificateValidationProvider(test01_T_userTrustAnchors, + true, intermCertsAndCrls); + + // create store with additional certificates and CRLs + content = new ArrayList(); + content.add(test01_T_tsaCRL_2); + content.add(test01_T_tsaCert.getCertificate()); // tsa cert is not added to token + CertStore tsaIntermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + // create validation provider with revocation information for TSA + test01_tsaValidationDataProviderNow = new PKIXTSACertificateValidationProvider( + test01_T_tsaTrustAnchors, true, tsaIntermCertsAndCrls); + } + + private static void createXadesXCerts(Date now) throws Exception, + CertificateEncodingException, KeyStoreException, IOException, + NoSuchAlgorithmException, CertificateException, + InvalidAlgorithmParameterException, NoSuchProviderException + { + X509CRL crl; + List certList; + TrustedCertificateEntry ca; + Collection content; + CertStore intermCertsAndCrls; + TrustedCertificateEntry tsaCA; + test02_X_userCaCert = FullCert.getCACert( + "RSA", + 1024, + "CN=XAdES4j XAdES-X User CA", + new Date(now.getTime() - ONE_HOUR_IN_MS * 24), + new Date(now.getTime() - ONE_HOUR_IN_MS * 16), + "SHA256withRSA"); + System.out.println("\"" + test02_X_userCaCert.getCertificate().getSubjectDN() + + "\" validity from " + test02_X_userCaCert.getCertificate().getNotBefore() + + " to " + test02_X_userCaCert.getCertificate().getNotAfter()); + + test02_X_tsaCaCert = FullCert.getCACert( + "RSA", + 1024, + "CN=XAdES4j XAdES-X TSA Testing CA", + new Date(now.getTime() - ONE_HOUR_IN_MS * 23), + new Date(now.getTime() + ONE_HOUR_IN_MS * 2), + "SHA256withRSA"); + System.out.println("\"" + test02_X_tsaCaCert.getCertificate().getSubjectDN() + + "\" validity from " + test02_X_tsaCaCert.getCertificate().getNotBefore() + + " to " + test02_X_tsaCaCert.getCertificate().getNotAfter()); + + test02_X_userCert = test02_X_userCaCert.createUserCert( + "RSA", + 1024, + "CN=XAdES4j test user", + new Date(now.getTime() - ONE_HOUR_IN_MS * 22), + // should be -16h, temporary fix for problems in xades4j when creating + // signature with past times, won't matter as the CA is valid to -16h + new Date(now.getTime() + ONE_HOUR_IN_MS), + new BigInteger("2"), + "SHA256withRSA"); + System.out.println("user certificate \"" + + test02_X_userCert.getCertificate().getSubjectDN() + + "\" validity from " + test02_X_userCert.getCertificate().getNotBefore() + + " to " + test02_X_userCert.getCertificate().getNotAfter()); + + + test02_X_tsa1Cert = test02_X_tsaCaCert.createTSACert( + "RSA", + 1024, + "CN=XAdES4j XAdES-X TSA 1", + new Date(now.getTime() - ONE_HOUR_IN_MS * 21), + new Date(now.getTime() - ONE_HOUR_IN_MS * 12), + new BigInteger("1"), + "SHA256withRSA"); + System.out.println("TSA certificate " + + test02_X_tsa1Cert.getCertificate().getSubjectDN().toString() + + " is valid from " + + test02_X_tsa1Cert.getCertificate().getNotBefore() + + " to " + + test02_X_tsa1Cert.getCertificate().getNotAfter()); + + CRLEntries entries_test02 = test02_X_userCaCert.new CRLEntries(); + entries_test02.addEntry( + test02_X_userCert.getCertificate().getSerialNumber(), + new Date(now.getTime() - ONE_HOUR_IN_MS * 18), + CRLReason.affiliationChanged); + + crl = test02_X_userCaCert.createCRL( + "SHA256withRSA", + new Date(now.getTime() - ONE_HOUR_IN_MS * 18), + new Date(now.getTime() - ONE_HOUR_IN_MS * 17), + new BigInteger("1"), + entries_test02); + + test02_X_tsa2Cert = test02_X_tsaCaCert.createTSACert( + "RSA", + 1024, + "CN=XAdES4j XAdES-X TSA 2", + new Date(now.getTime() - ONE_HOUR_IN_MS * 15), + new Date(now.getTime() + ONE_HOUR_IN_MS), + new BigInteger("3"), + "SHA256withRSA"); + System.out.println("Certificate " + + test02_X_tsa2Cert.getCertificate().getSubjectDN().toString() + + " is valid from " + + test02_X_tsa2Cert.getCertificate().getNotBefore() + + " to " + + test02_X_tsa2Cert.getCertificate().getNotAfter()); + + entries_test02 = test02_X_tsaCaCert.new CRLEntries(); + + test02_X_tsaCRL_1 = test02_X_tsaCaCert.createCRL( + "SHA256withRSA", + new Date(now.getTime() - ONE_HOUR_IN_MS * 19), + new Date(now.getTime() - ONE_HOUR_IN_MS * 13), + new BigInteger("4"), + entries_test02); + + entries_test02.addEntry( + test02_X_tsa1Cert.getCertificate().getSerialNumber(), + new Date(now.getTime() - ONE_HOUR_IN_MS * 13), + CRLReason.cessationOfOperation); + + test02_X_tsaCRL_2 = test02_X_tsaCaCert.createCRL( + "SHA256withRSA", + new Date(now.getTime() - ONE_HOUR_IN_MS * 13), + new Date(now.getTime() + ONE_HOUR_IN_MS), + new BigInteger("5"), + entries_test02); + + certList = new ArrayList(); + certList.add(test02_X_userCaCert.getCertificate()); + test02_X_userCaStore = new JcaCertStore(certList); + + test02_X_userTrustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + test02_X_userTrustAnchors.load(null); + ca = new TrustedCertificateEntry(test02_X_userCaCert.getCertificate()); + test02_X_userTrustAnchors.setEntry("ca", ca, null); + + test02_X_tsaTrustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + test02_X_tsaTrustAnchors.load(null); + tsaCA = new TrustedCertificateEntry(test02_X_tsaCaCert.getCertificate()); + test02_X_tsaTrustAnchors.setEntry("tsaCA", tsaCA, null); + + test02_keyingDataproviderNow = new DirectKeyingDataProvider( + test02_X_userCert.getCertificate(), + test02_X_userCert.getPrivateKey()); + + content = new ArrayList(); + content.add(crl); + + intermCertsAndCrls = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); + + test02_userCertValidationDataProviderXCreation = + new PKIXCertificateValidationProvider( + test02_X_userTrustAnchors, + true, + intermCertsAndCrls); + + content = new ArrayList(); + content.add(test02_X_tsaCRL_1); + content.add(test02_X_tsaCRL_2); + content.add(test02_X_tsa1Cert.getCertificate()); + + intermCertsAndCrls = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); + + test02_tsaCertValidationDataProviderXCreation = + new PKIXTSACertificateValidationProvider( + test02_X_tsaTrustAnchors, + true, + intermCertsAndCrls); + + content = new ArrayList(); + content.add(test02_X_tsa1Cert.getCertificate()); + content.add(test02_X_tsa2Cert.getCertificate()); + content.add(test02_X_tsaCRL_1); + content.add(test02_X_tsaCRL_2); + + intermCertsAndCrls = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); + + test02_tsaCertValidationDataProviderNow = + new PKIXTSACertificateValidationProvider( + test02_X_tsaTrustAnchors, + true, + intermCertsAndCrls); + + test02_userCertMinimalValidationDataProvider = + new PKIXCertificateValidationProvider(test02_X_userTrustAnchors, + true, + emptyCertStore); + test02_tsaCertMinimalValidationDataProvider = + new PKIXTSACertificateValidationProvider(test02_X_tsaTrustAnchors, + true, + emptyCertStore); + } + + @Test + public void init() throws Exception + { + // cause the static initializer to run + return; + } + + + /* + * Generator creates signature with certificates and time stamps created in the past + * + * ^ + * | <-- in 1h: + * | caCert validity end + * | + * | <-- in 30 min: + * | userCert validity end + * | tsaCert validity end + * | CRL (3) validity end + * | + * | <-- in 15 min: + * | CRL (2) validity end + * | + * | <-- *now* (signature validation) + * | + * | <- 1m ago: + * | CRL (3) creation + * | + * | <- 30 min ago: + * | CRL (2) creation + * | time stamp token creation + * | + * | <-- 1h ago: + * | caCert creation + * | userCert creation + * | tsaCert creation + */ + + // test creation of document with time stamp in the past + @Test + public void test01_T_sig1() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + // test signing + SurrogateTimeStampTokenProvider.setTSACert(test01_T_tsaCert, test01_T_userCaStore); + SurrogateTimeStampTokenProvider.setTimeAndSerial( + new Date(new Date().getTime() - ONE_HOUR_IN_MS/2), + new BigInteger("3")); + System.out.println("SignatureTimeStamp creation date in " + + "\"document.aged.testT_1s\" is " + + new Date(new Date().getTime() - ONE_HOUR_IN_MS/2)); + + Document doc = getDocument("document.xml"); + Element elemToSign = doc.getDocumentElement(); + XadesSigningProfile signer = new XadesTSigningProfile(test01_keyingDataProviderNow); + signer.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + new Enveloped(signer.newSigner()).sign(elemToSign); + + outputDocument(doc, "document.aged.testT_1s.xml"); + } + + // test if document can be validated using revocation information published before + // time stamp generation (TODO should fail if we support grace period) + @Test + public void test01_T_ver1() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + // test verification + XAdESForm f = verifySignature("document.aged.testT_1s.xml", + new XadesVerificationProfile(test01_userCertValidationDataProviderPast30m, + test01_tsaValidationDataProviderPast30m)); + assertEquals(XAdESForm.T, f); + } + + // test if document can be validated using current revocation information + @Test + public void test01_T_ver2() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + // test verification + XAdESForm f = verifySignature("document.aged.testT_1s.xml", + new XadesVerificationProfile(test01_userCertValidationDataProviderNow, + test01_tsaValidationDataProviderNow)); + assertEquals(XAdESForm.T, f); + } + + // test if document can be validated if user certificate was revoked after + // signature was time stamped + // XXX fails if the CertPathBuilder considers certificate to be revoked before their + // revocation date + // BC provider has such behavior for revocation reason unspecified, keyCompromise, + // aACompromise and few others + @Test + public void test01_T_ver3() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + CRLEntries entries = test01_T_userCaCert.new CRLEntries(); + + // revoke user certificate 15 min ago + entries.addEntry(test01_T_userCert.getCertificate().getSerialNumber(), + new Date(new Date().getTime() - ONE_HOUR_IN_MS/4), CRLReason.unspecified); + System.out.println("User certificate revoked at " + + new Date(new Date().getTime() - ONE_HOUR_IN_MS/4)); + + // create CRL + X509CRL revokedCerts = test01_T_userCaCert.createCRL("SHA1withRSA", + new Date(new Date().getTime() - ONE_HOUR_IN_MS/60), // generated 1 min ago + new Date(new Date().getTime() + ONE_HOUR_IN_MS/2), // nextUpdate in 30 min + new BigInteger("4"), + entries); + + // create validation provider with CRL with revoked user cert + Collection content = new ArrayList(); + content.add(revokedCerts); + content.add(test01_T_tsaCert.getCertificate()); // tsa cert is not added to token + CertStore intermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + CertificateValidationProvider cvp = new PKIXCertificateValidationProvider( + test01_T_userTrustAnchors, true, intermCertsAndCrls); + + XAdESForm f = verifySignature("document.aged.testT_1s.xml", + new XadesVerificationProfile(cvp, + test01_tsaValidationDataProviderNow)); + assertEquals(XAdESForm.T, f); + } + + // test if document can be validated if user certificate was revoked after + // signature was time stamped + // exact same test as testT_3v, with the change to a more "harmless" revocation + // reason than unspecified: affiliation changed. + @Test + public void test01_T_ver3_1() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + CRLEntries entries = test01_T_userCaCert.new CRLEntries(); + + // revoke user certificate 15 min ago + entries.addEntry(test01_T_userCert.getCertificate().getSerialNumber(), + new Date(new Date().getTime() - ONE_HOUR_IN_MS/4), CRLReason.affiliationChanged); + System.out.println("User certificate revoked at " + + new Date(new Date().getTime() - ONE_HOUR_IN_MS/4)); + + // create CRL + X509CRL revokedCerts = test01_T_userCaCert.createCRL("SHA1withRSA", + new Date(new Date().getTime() - ONE_HOUR_IN_MS/60), // generated 1 min ago + new Date(new Date().getTime() + ONE_HOUR_IN_MS/2), // nextUpdate in 30 min + new BigInteger("4"), + entries); + + // create validation provider with CRL with revoked user cert + Collection content = new ArrayList(); + content.add(revokedCerts); + content.add(test01_T_tsaCert.getCertificate()); // tsa cert is not added to token + CertStore intermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + CertificateValidationProvider cvp = new PKIXCertificateValidationProvider( + test01_T_userTrustAnchors, true, intermCertsAndCrls); + + XAdESForm f = verifySignature("document.aged.testT_1s.xml", + new XadesVerificationProfile(cvp, + test01_tsaValidationDataProviderNow)); + assertEquals(XAdESForm.T, f); + } + + + // test if document can be validated if user certificate was revoked before + // signature was time stamped + @Test(expected = CannotBuildCertificationPathException.class) + public void test01_T_ver4() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + CRLEntries entries = test01_T_userCaCert.new CRLEntries(); + + // revoke user certificate 45 min ago + entries.addEntry(test01_T_userCert.getCertificate().getSerialNumber(), + new Date(new Date().getTime() - 1000*60*45), CRLReason.unspecified); + System.out.println("User certificate revoked at " + + new Date(new Date().getTime() - 1000*60*45)); + + // create CRL + X509CRL revokedCerts = test01_T_userCaCert.createCRL("SHA1withRSA", + new Date(new Date().getTime() - 1000*60), // generated 1 min ago + new Date(new Date().getTime() + 1000*60*30), // nextUpdate in 30 min + new BigInteger("4"), + entries); + + // create validation provider with CRL with revoked user cert + Collection content = new ArrayList(); + content.add(revokedCerts); + content.add(test01_T_tsaCert.getCertificate()); // tsa cert is not added to token + CertStore intermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + CertificateValidationProvider cvp = new PKIXCertificateValidationProvider( + test01_T_userTrustAnchors, true, intermCertsAndCrls); + + XAdESForm f = verifySignature("document.aged.testT_1s.xml", + new XadesVerificationProfile(cvp, test01_tsaValidationDataProviderNow)); + assertEquals(XAdESForm.T, f); + } + + /* SigAndRefsTimeStamp tests + * + * worst case scenario for validation that still should validate successfully + */ + /* t + * -24 .User CA validity + * -23 | .TSA CA validity + * -22 | | .User cert validity + * -21 | | | .TSA1 cert validity + * | | | | + * -20 | | | | <---- XAdES-T time stamp (TSA1) + * | | | | + * -19 | | | | .TSA CA 1st CRL + * -18 | | | | | .User CA 1st CRL (user cert revocation) + * | | | | | | + * -17 ' | ' | | ' + * -15 | | | .TSA2 cert validity + * | | | | + * -14 | | | | <---- XAdES-X time stamp (TSA2) + * | | | | + * -13 | | ' | .TSA CA 2nd CRL (TSA1 cert revocation) + * -12 | ' | | + * 0 | | | <---- (now) validation + * 1 | ' ' + * 2 ' + */ + + // create basic XAdES-T signed document + @Test + public void test02_X_sig1() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + SurrogateTimeStampTokenProvider.setTSACert(test02_X_tsa1Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTimeAndSerial( + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20), + new BigInteger("1")); + System.out.println("SignatureTimeStamp creation date is " + + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20)); + + Document doc = getDocument("document.xml"); + Element elemToSign = doc.getDocumentElement(); + XadesSigningProfile signer = new XadesTSigningProfile(test02_keyingDataproviderNow); + signer.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + new Enveloped(signer.newSigner()).sign(elemToSign); + + outputDocument(doc, "document.aged.test02_X_sig1.xml"); + } + + // extend T form to X form + @Test + public void test02_X_sig2() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + SurrogateTimeStampTokenProvider.setTSACert(test02_X_tsa2Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTimeAndSerial( + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14), + new BigInteger("2")); + + System.out.println("SigAndRefsTimeStamp creation date is " + + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + Document doc = getDocument("document.aged.test02_X_sig1.xml"); + Element signatureNode = getSigElement(doc); + + /* + * extension of signature to X form must be performed in two steps, first we have + * to create the XML with needed Properties (CompleteRevocationRefs and + * CompleteCertificateRefs, that is, C form) and only after that we can add the + * X form time stamp + */ + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test02_userCertValidationDataProviderXCreation, + test02_tsaCertValidationDataProviderXCreation); + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + // extend T to C + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.C, + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + assertEquals(res.getSignatureForm(), XAdESForm.T); + + // extend C to X + res = verifier.verify(signatureNode, null, formExt, XAdESForm.X, + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + assertEquals(res.getSignatureForm(), XAdESForm.C); + + outputDocument(doc, "document.aged.test02_X_sig2.xml"); + } + + // extend X to X-L form + @Test + public void test02_X_sig3() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + Document doc = getDocument("document.aged.test02_X_sig2.xml"); + Element signatureNode = getSigElement(doc); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test02_userCertValidationDataProviderXCreation, + test02_tsaCertValidationDataProviderNow); + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + // extend X to X-L + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.X_L); + + assertEquals(res.getSignatureForm(), XAdESForm.X); + + outputDocument(doc, "document.aged.test02_X_sig3.xml"); + } + + // verify if the X form was properly created + @Test + public void test02_X_ver1() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + // test verification + XAdESForm f = verifySignature("document.aged.test02_X_sig2.xml", + new XadesVerificationProfile(test02_userCertValidationDataProviderXCreation, + test02_tsaCertValidationDataProviderNow)); + + assertEquals(XAdESForm.X, f); + } + + // verify if the X-L form was properly created by using validators with just CA + // certificates, without CRLs or leaf certificates + @Test + public void test02_X_ver2() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + // verify using minimal data (just CA certificates) + XAdESForm f = verifySignature("document.aged.test02_X_sig3.xml", + new XadesVerificationProfile(test02_userCertMinimalValidationDataProvider, + test02_tsaCertMinimalValidationDataProvider)); + + assertEquals(XAdESForm.X_L, f); + } + + /* + * end of tests + */ + + // helper method + private XAdESForm verifySignature(String path, + XadesVerificationProfile p) + throws FileNotFoundException, ParserConfigurationException, + SAXException, IOException, XadesProfileResolutionException, XAdES4jException + { + Element signatureNode = getSigElement(getDocument(path)); + XAdESVerificationResult res = p.newVerifier().verify(signatureNode, null); + return res.getSignatureForm(); + } + + // helper method + private Element getSigElement(Document document) + { + return (Element)document.getElementsByTagNameNS(Constants.SignatureSpecNS, + Constants._TAG_SIGNATURE).item(0); + } + + // helper method + private void outputDocument(Document doc, String path) + throws TransformerConfigurationException, + TransformerException, IOException + { + path = toDocumentDirFilePath(path); + TransformerFactory tf = TransformerFactory.newInstance(); + FileOutputStream out = new FileOutputStream(path); + tf.newTransformer().transform( + new DOMSource(doc), + new StreamResult(out)); + out.flush(); + out.getFD().sync(); + out.close(); + } + + // helper method + private static void saveCRL(String path, X509CRL crl) + throws CRLException, IOException + { + path = "./src/test/cert/aged/" + path; + FileOutputStream fos = new FileOutputStream(path); + fos.write(crl.getEncoded()); + fos.close(); + return; + } + + // helper method + private String toDocumentDirFilePath(String path) + { + return "./src/test/xml/" + path; + } + + // helper method + private static void saveCertificate(String path, X509Certificate cert) + throws CertificateEncodingException, IOException + { + path = "./src/test/cert/aged/" + path; + FileOutputStream fos = new FileOutputStream(path); + fos.write(cert.getEncoded()); + fos.close(); + return; + } + + // helper method + private Document getDocument(String path) throws ParserConfigurationException, + FileNotFoundException, SAXException, IOException + { + path = toDocumentDirFilePath(path); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document doc = db.parse(new FileInputStream(path)); + Element elem = doc.getDocumentElement(); + DOMHelper.useIdAsXmlId(elem); + return doc; + } +} diff --git a/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java b/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java new file mode 100644 index 00000000..c23240de --- /dev/null +++ b/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java @@ -0,0 +1,225 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Date; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; + +import org.apache.xml.security.algorithms.MessageDigestAlgorithm; +import org.bouncycastle.asn1.ASN1ObjectIdentifier; +import org.bouncycastle.asn1.DERNull; +import org.bouncycastle.asn1.DERSet; +import org.bouncycastle.asn1.cms.Attribute; +import org.bouncycastle.asn1.cms.AttributeTable; +import org.bouncycastle.asn1.cms.CMSAttributes; +import org.bouncycastle.asn1.cms.Time; +import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers; +import org.bouncycastle.asn1.x509.AlgorithmIdentifier; +import org.bouncycastle.cms.DefaultSignedAttributeTableGenerator; +import org.bouncycastle.cms.SignerInfoGenerator; +import org.bouncycastle.cms.SignerInformationVerifier; +import org.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilder; +import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoGeneratorBuilder; +import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder; +import org.bouncycastle.operator.DigestCalculator; +import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; +import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder; +import org.bouncycastle.tsp.TSPAlgorithms; +import org.bouncycastle.tsp.TimeStampRequest; +import org.bouncycastle.tsp.TimeStampRequestGenerator; +import org.bouncycastle.tsp.TimeStampResponse; +import org.bouncycastle.tsp.TimeStampResponseGenerator; +import org.bouncycastle.tsp.TimeStampToken; +import org.bouncycastle.tsp.TimeStampTokenGenerator; +import org.bouncycastle.util.Store; + +import com.google.inject.Inject; + +import xades4j.UnsupportedAlgorithmException; +import xades4j.providers.MessageDigestEngineProvider; +import xades4j.providers.TimeStampTokenGenerationException; +import xades4j.providers.TimeStampTokenProvider; + +/** + * TimeStampTokenProvider that uses its own internal time source and generator + * @author Hubert Kario + * + */ +// only package visible, users shouldn't use this class +class SurrogateTimeStampTokenProvider implements TimeStampTokenProvider +{ + private static FullCert tsaCert; + private static String algorithm = "SHA1withRSA"; + private static Store caCerts; + private static Date now = null; + private static BigInteger serial; + + private static final Map digestUriToOidMappings; + static + { + digestUriToOidMappings = new HashMap(6); + digestUriToOidMappings.put(MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5, TSPAlgorithms.MD5); + digestUriToOidMappings.put(MessageDigestAlgorithm.ALGO_ID_DIGEST_RIPEMD160, TSPAlgorithms.RIPEMD160); + digestUriToOidMappings.put(MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1, TSPAlgorithms.SHA1); + digestUriToOidMappings.put(MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256, TSPAlgorithms.SHA256); + digestUriToOidMappings.put(MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA384, TSPAlgorithms.SHA384); + digestUriToOidMappings.put(MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA512, TSPAlgorithms.SHA512); + } + + private MessageDigestEngineProvider mdEngineProvider; + + /** + * change time stamp token signature algorithm from default SHA1withRSA + * @param alg + */ + public static void setSigAlgorithm(String alg) + { + algorithm = alg; + } + + public static void setTSACert(FullCert cert, Store caCerts) + { + tsaCert = cert; + SurrogateTimeStampTokenProvider.caCerts = caCerts; + } + + public static void setTimeAndSerial(Date time, BigInteger serial) + { + now = time; + SurrogateTimeStampTokenProvider.serial = serial; + } + + @Inject + public SurrogateTimeStampTokenProvider(MessageDigestEngineProvider messageDigest) + { + mdEngineProvider = messageDigest; + } + + @Override + public TimeStampTokenRes getTimeStampToken(byte[] tsDigestInput, + String digestAlgUri) throws TimeStampTokenGenerationException + { + if (now == null) + throw new IllegalStateException("Double use or not initialised"); + + try + { + // calculate digest of data + MessageDigest md = mdEngineProvider.getEngine(digestAlgUri); + byte[] digest = md.digest(tsDigestInput); + + // create time stamp token generator + TimeStampTokenGenerator tokenGenerator; + DigestCalculator sha1DigestCalculator = new DigestCalculator() + { + /* SHA1 is hardcoded in few places in the library itself so hardcoding it + * ourselves we don't make the situation as bad as it looks + */ + private ByteArrayOutputStream bOut = new ByteArrayOutputStream(); + + public AlgorithmIdentifier getAlgorithmIdentifier() + { + return new AlgorithmIdentifier(OIWObjectIdentifiers.idSHA1, DERNull.INSTANCE); + } + + public OutputStream getOutputStream() + { + return bOut; + } + + public byte[] getDigest() + { + try + { + return MessageDigest.getInstance("SHA-1").digest(bOut.toByteArray()); + } + catch (NoSuchAlgorithmException e) + { + throw new IllegalStateException("Cannot create sha-1 hash: "+ e.getMessage()); + } + } + }; + /* because Bouncy Castle adds *two* timestamps to a token (one from system + * time, in attributes of CMS signature, and one from Date passed to + * generate() method we have to override the first one. + * + * Otherwise we could simply run + * + * SignerInfoGenerator signerInfoGen = new JcaSimpleSignerInfoGeneratorBuilder() + * .build(algorithm, tsaCert.getPrivateKey(), tsaCert.getCertificate()); + */ + JcaSignerInfoGeneratorBuilder sigBuilder = new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()); + + // create default signingTime CMS attribute to be added to + // signedAttributes + // in CMS (RFC 3161 token) signature + Hashtable signedAttr = + new Hashtable(); + Attribute attr = new Attribute(CMSAttributes.signingTime, + new DERSet(new Time(now))); + signedAttr.put(attr.getAttrType(), attr); + AttributeTable signedAttributeTable = new AttributeTable(signedAttr); + + sigBuilder.setSignedAttributeGenerator( + new DefaultSignedAttributeTableGenerator(signedAttributeTable)); + + SignerInfoGenerator signerInfoGen = sigBuilder.build( + new JcaContentSignerBuilder(algorithm).setProvider("BC") + .build(tsaCert.getPrivateKey()), tsaCert + .getCertificate()); + + // "1.2" is a "no policy" policy ID + tokenGenerator = new TimeStampTokenGenerator(sha1DigestCalculator, + signerInfoGen,new ASN1ObjectIdentifier("1.2")); + + //tokenGenerator.addCertificates(caCerts); + + // generate signing request + TimeStampRequestGenerator reqGen = new TimeStampRequestGenerator(); + TimeStampRequest request = reqGen.generate(digestUriToOidMappings.get(digestAlgUri), digest); + + // create response signer + TimeStampResponseGenerator tsrg = new TimeStampResponseGenerator(tokenGenerator, + TSPAlgorithms.ALLOWED); + + // sign request + TimeStampResponse resp = tsrg.generate(request, serial, now); + + // extract token from response + TimeStampToken tsToken = resp.getTimeStampToken(); + + now = null; // reset, so that every use needs to set time it wants to see + + return new TimeStampTokenRes(tsToken.getEncoded(), + tsToken.getTimeStampInfo().getGenTime()); + + } catch (UnsupportedAlgorithmException e) + { + throw new TimeStampTokenGenerationException("Digest algorithm not supported", e); + } catch (Exception e) + { + throw new TimeStampTokenGenerationException("Something went wrong", e); + } + } +} From bb7cd968cfb1bb78d26ac1235c0da5792ab5706f Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Wed, 24 Oct 2012 19:48:47 +0200 Subject: [PATCH 12/84] add tests of CertPathBuilder Signed-off-by: Tiago Rossi --- .../verification/CertPathBuilderTest.java | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 src/test/java/xades4j/verification/CertPathBuilderTest.java diff --git a/src/test/java/xades4j/verification/CertPathBuilderTest.java b/src/test/java/xades4j/verification/CertPathBuilderTest.java new file mode 100644 index 00000000..d77a893b --- /dev/null +++ b/src/test/java/xades4j/verification/CertPathBuilderTest.java @@ -0,0 +1,235 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.math.BigInteger; +import java.security.KeyStore; +import java.security.KeyStore.Entry; +import java.security.Security; +import java.security.KeyStore.TrustedCertificateEntry; +import java.security.cert.CRLException; +import java.security.cert.CertPath; +import java.security.cert.CertPathBuilder; +import java.security.cert.CertPathBuilderException; +import java.security.cert.CertStore; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CollectionCertStoreParameters; +import java.security.cert.PKIXBuilderParameters; +import java.security.cert.PKIXCertPathBuilderResult; +import java.security.cert.X509CRL; +import java.security.cert.X509CertSelector; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; + +import org.bouncycastle.asn1.x509.CRLReason; +import org.bouncycastle.x509.ExtendedPKIXParameters; +import org.junit.Test; + +import xades4j.verification.FullCert.CRLEntries; + +public class CertPathBuilderTest +{ + private static FullCert caCert; + private static FullCert userCert; + private static FullCert user2Cert; + private static KeyStore trustAnchors; + static + { + try { + Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); + + caCert = FullCert.getCACert("RSA", 1024, "CN=XAdES4j Testing CA", + new Date(new Date().getTime() - 1000*60*60), + new Date(new Date().getTime() + 1000*60*60), + "SHA256withRSA"); /* cert will have serial number: 1 */ + saveCertificate("ca.cer", caCert.getCertificate()); + + userCert = caCert.createUserCert("RSA", 1024, "CN=User Certificate", + new Date(new Date().getTime() - 1000*60*60), + new Date(new Date().getTime() + 1000*60*30), + new BigInteger("2"), "SHA256withRSA"); + saveCertificate("user.cer", userCert.getCertificate()); + + user2Cert = caCert.createTSACert("RSA", 1024, "CN=User 2 Certificate", + new Date(new Date().getTime() - 1000*60*60), + new Date(new Date().getTime() - 1000*60*30), + new BigInteger("3"), "SHA256withRSA"); + saveCertificate("user2.cer", user2Cert.getCertificate()); + + trustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + trustAnchors.load(null, null); + Entry caEntry = new TrustedCertificateEntry(caCert.getCertificate()); + trustAnchors.setEntry("ca", caEntry, null); + + } catch (Exception ex) + { + throw new RuntimeException("static initialization failed", ex); + } + } + + /* + * Generator creates certificates with validity periods in the past: + * + * ^ + * | <-- in 1h: + * | caCert validity end + * | + * | <-- in 30 min: + * | userCert validity end + * | + * | <-- in 20 min: + * | CRL validity end (test1, test2) + * | + * | <-- *now* + * | + * | <- 1m ago: + * | CRL creation (test1, test2) + * | + * | <- 30 min ago: + * | user2Cert validity end + * | + * | <-- 45 min ago: + * | user2Cert validation + * | + * | <-- 1h ago: + * | caCert creation + * | userCert creation + * | user2Cert creation + */ + + /* + * revoke certificate 1min ago, try to validate it before that (15min ago) + * XXX fails with BC provider + */ + @Test + public void test1() throws Exception + { + System.out.println("test1"); + + CertPathBuilder builder = CertPathBuilder.getInstance("PKIX", "BC"); + + X509CertSelector userCertSelector = new X509CertSelector(); + userCertSelector.setCertificate(userCert.getCertificate()); + + PKIXBuilderParameters buildParams = new PKIXBuilderParameters(trustAnchors, userCertSelector); + + // create CRL with user cert revoked after the time we will verify it at + CRLEntries entries = caCert.new CRLEntries(); + entries.addEntry(userCert.getCertificate().getSerialNumber(), + new Date(new Date().getTime() - 1000*60), CRLReason.unspecified); + X509CRL crl = caCert.createCRL("SHA256withRSA", + new Date(new Date().getTime() - 1000*60), + new Date(new Date().getTime() + 1000*60*20), + new BigInteger("3"), + entries); + saveCRL("test1.crl", crl); + + Collection content = new ArrayList(); + content.add(crl); + content.add(userCert.getCertificate()); + //content.add(tsaCert.getCertificate()); + CertStore intermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + + buildParams.addCertStore(intermCertsAndCrls); + buildParams.setRevocationEnabled(true); + buildParams.setDate(new Date(new Date().getTime() - 1000*60*15)); + + ExtendedPKIXParameters extBuildParams = ExtendedPKIXParameters.getInstance(buildParams); + extBuildParams.setValidityModel(ExtendedPKIXParameters.PKIX_VALIDITY_MODEL); + + PKIXCertPathBuilderResult result = (PKIXCertPathBuilderResult) builder.build(buildParams); + CertPath certPath = result.getCertPath(); + + System.out.println(certPath.getCertificates().get(0).getType()); + } + + /* + * Try to validate certificate using CRL published after certificate validity end + */ + @Test(expected = CertPathBuilderException.class) + public void test2() throws Exception + { + System.out.println("test2"); + // test verification + CertPathBuilder builder = CertPathBuilder.getInstance("PKIX", "BC"); + + X509CertSelector userCertSelector = new X509CertSelector(); + userCertSelector.setCertificate(user2Cert.getCertificate()); + + PKIXBuilderParameters buildParams = new PKIXBuilderParameters(trustAnchors, userCertSelector); + + // create empty CRL + CRLEntries entries = caCert.new CRLEntries(); + X509CRL crl = caCert.createCRL("SHA256withRSA", + new Date(new Date().getTime() - 1000*60), + new Date(new Date().getTime() + 1000*60*20), + new BigInteger("3"), + entries); + saveCRL("test2.crl", crl); + + Collection content = new ArrayList(); + content.add(crl); + content.add(user2Cert.getCertificate()); + //content.add(tsaCert.getCertificate()); + CertStore intermCertsAndCrls = CertStore.getInstance("Collection", + new CollectionCertStoreParameters(content)); + + buildParams.addCertStore(intermCertsAndCrls); + buildParams.setRevocationEnabled(true); + buildParams.setDate(new Date(new Date().getTime() - 1000*60*45)); // 45 minutes ago + + ExtendedPKIXParameters extBuildParams = ExtendedPKIXParameters.getInstance(buildParams); + extBuildParams.setValidityModel(ExtendedPKIXParameters.PKIX_VALIDITY_MODEL); + + PKIXCertPathBuilderResult result = (PKIXCertPathBuilderResult) builder.build(buildParams); + CertPath certPath = result.getCertPath(); + + System.out.println(certPath.getCertificates().get(0).getType()); + + } + + /* + * end of tests + */ + + // helper method + private static void saveCRL(String path, X509CRL crl) + throws CRLException, IOException + { + path = "./src/test/cert/certpath/" + path; + FileOutputStream fos = new FileOutputStream(path); + fos.write(crl.getEncoded()); + fos.close(); + return; + } + + // helper method + private static void saveCertificate(String path, X509Certificate cert) + throws CertificateEncodingException, IOException + { + path = "./src/test/cert/certpath/" + path; + FileOutputStream fos = new FileOutputStream(path); + fos.write(cert.getEncoded()); + fos.close(); + return; + } +} From 1231d52f4011e653c536b24c8d05afb9182f7b18 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Fri, 14 Dec 2012 20:49:47 +0100 Subject: [PATCH 13/84] fix test01_T_ver2 caused by bug in X509CRLSelector Sun implementation of X509CRLSelector doesn't return CRLs published after the date provided to it using the setDateAndTime() method this makes it very hard to validate certificates in the past (one needs CRL from time of verification) and impossible to enforce grace period (which requires using CRLs published after the time of verification). The correct behaviour is in Bouncy Castle provider, so use it instead. http://java.sun.com/javase/6/docs/technotes/guides/security/certpath/CertPathProgGuide.html#X509CRLSelector http://www.bouncycastle.org/jira/browse/BJA-249 Signed-off-by: Tiago Rossi --- .../impl/PKIXCertificateValidationProviderBase.java | 2 +- src/test/java/xades4j/utils/SignatureServicesTestBase.java | 3 +++ .../java/xades4j/verification/XadesVerifierErrorsTest.java | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java index 7e7504e5..e3b6d60e 100644 --- a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java +++ b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java @@ -102,7 +102,7 @@ public PKIXCertificateValidationProviderBase( this.maxPathLength = maxPathLength; this.certPathBuilder = certPathBuilderProvider == null ? - CertPathBuilder.getInstance("PKIX") : + CertPathBuilder.getInstance("PKIX", "BC") : CertPathBuilder.getInstance("PKIX", certPathBuilderProvider); this.signatureProvider = signatureProvider; this.intermCertsAndCrls = intermCertsAndCrls; diff --git a/src/test/java/xades4j/utils/SignatureServicesTestBase.java b/src/test/java/xades4j/utils/SignatureServicesTestBase.java index 9f301ca6..3cd75907 100644 --- a/src/test/java/xades4j/utils/SignatureServicesTestBase.java +++ b/src/test/java/xades4j/utils/SignatureServicesTestBase.java @@ -19,6 +19,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.security.Security; + import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -41,6 +43,7 @@ public class SignatureServicesTestBase { try { + Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); db = dbf.newDocumentBuilder(); diff --git a/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java b/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java index 72edae52..e3a145d5 100644 --- a/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java @@ -20,7 +20,8 @@ import org.junit.Test; import static org.junit.Assert.*; import org.junit.Before; -import xades4j.providers.CannotSelectCertificateException; + +import xades4j.providers.CannotBuildCertificationPathException; import xades4j.providers.impl.PKIXCertificateValidationProvider; /** @@ -70,7 +71,7 @@ public void testErrVerifyIncorrectC() throws Exception verifyBadSignature("document.signed.c.bad.xml",nistVerificationProfile); } - @Test(expected = CannotSelectCertificateException.class) + @Test(expected = CannotBuildCertificationPathException.class) public void testErrVerifyNoSignCert() throws Exception { System.out.println("ErrVerifyNoSignCert"); From 1126b580486d6dbe2f8a4bbf8a452e796f589369 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sat, 15 Dec 2012 18:12:13 +0100 Subject: [PATCH 14/84] use the new verifier implementation Use new verifier implementation, for now it's mostly a copy of the old verifier. Signed-off-by: Tiago Rossi --- .../xades4j/verification/SignatureUtils.java | 34 ++ .../verification/XadesHybridVerifierImpl.java | 397 +++++++++++++++++- .../XadesVerificationProfile.java | 4 +- 3 files changed, 428 insertions(+), 7 deletions(-) diff --git a/src/main/java/xades4j/verification/SignatureUtils.java b/src/main/java/xades4j/verification/SignatureUtils.java index 34ede98a..c65b813a 100644 --- a/src/main/java/xades4j/verification/SignatureUtils.java +++ b/src/main/java/xades4j/verification/SignatureUtils.java @@ -1,6 +1,7 @@ /* * XAdES4j - A Java library for generation and verification of XAdES signatures. * Copyright (C) 2010 Luis Goncalves. + * Copyrigth (C) 2012 Hubert Kario - QBS. * * XAdES4j is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -339,4 +340,37 @@ static void checkSignedPropertiesIncorporation(Element qualifyingPropsElem, Refe throw new QualifyingPropertiesIncorporationException("Cannot get the referenced SignedProperties", ex); } } + + /** + * Checks if QualifyingProperties references provided Signature + * @param signatureId + * @param qualifyingPropsElem + * @throws QualifyingPropertiesIncorporationException + */ + public static void checkQualifyingPropertiesTarget(String signatureId, + Element qualifyingPropsElem) + throws QualifyingPropertiesIncorporationException + { + Node targetAttr = qualifyingPropsElem.getAttributeNodeNS(null, + QualifyingProperty.TARGET_ATTR); + if (null == targetAttr) + { + targetAttr = qualifyingPropsElem.getAttributeNodeNS( + QualifyingProperty.XADES_XMLNS, + QualifyingProperty.TARGET_ATTR); + if (null == targetAttr) + { + throw new QualifyingPropertiesIncorporationException( + "QualifyingProperties Target attribute not present"); + } + } + String targetValue = targetAttr.getNodeValue(); + if (null == targetValue + || !targetValue.startsWith("#") + || !targetValue.substring(1).equals(signatureId)) + { + throw new QualifyingPropertiesIncorporationException( + "QualifyingProperties target doesn't match the signature's Id"); + } + } } diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java index 522082d1..78f358f0 100644 --- a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -16,22 +16,184 @@ */ package xades4j.verification; +import java.io.InputStream; +import java.security.cert.X509CRL; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collection; import java.util.Date; +import java.util.List; +import java.util.Set; +import org.apache.xml.security.exceptions.XMLSecurityException; +import org.apache.xml.security.signature.Reference; +import org.apache.xml.security.signature.SignedInfo; +import org.apache.xml.security.signature.XMLSignature; +import org.apache.xml.security.signature.XMLSignatureException; +import org.apache.xml.security.utils.resolver.ResourceResolver; +import org.apache.xml.security.utils.resolver.implementations.ResolverAnonymous; import org.w3c.dom.Element; +import com.google.inject.Inject; + import xades4j.XAdES4jException; +import xades4j.XAdES4jXMLSigException; import xades4j.production.XadesSignatureFormatExtender; +import xades4j.properties.QualifyingProperty; +import xades4j.properties.SignatureTimeStampProperty; +import xades4j.properties.UnsignedProperties; +import xades4j.properties.UnsignedSignatureProperty; +import xades4j.properties.data.PropertyDataObject; +import xades4j.properties.data.SignatureTimeStampData; +import xades4j.providers.CertificateValidationProvider; +import xades4j.providers.ValidationData; +import xades4j.utils.CollectionUtils; +import xades4j.utils.PropertiesUtils; +import xades4j.verification.RawSignatureVerifier.RawSignatureVerifierContext; +import xades4j.verification.SignatureUtils.KeyInfoRes; +import xades4j.verification.SignatureUtils.ReferencesRes; +import xades4j.xml.unmarshalling.QualifyingPropertiesUnmarshaller; +import xades4j.xml.unmarshalling.UnmarshalException; public class XadesHybridVerifierImpl implements XadesVerifier { + static + { + org.apache.xml.security.Init.init(); + initFormExtension(); + } + private final CertificateValidationProvider certificateValidator; + private final QualifyingPropertiesVerifier qualifyingPropertiesVerifier; + private final Set rawSigVerifiers; + private final Set customSigVerifiers; + private QualifyingPropertiesUnmarshaller qualifPropsUnmarshaller; + + @Inject + protected XadesHybridVerifierImpl( + CertificateValidationProvider certificateValidator, + QualifyingPropertiesVerifier qualifyingPropertiesVerifier, + QualifyingPropertiesUnmarshaller qualifyingPropsUnmarshaller, + Set rawSigVerifiers, + Set customSigVerifiers) + { + this.certificateValidator = certificateValidator; + this.qualifyingPropertiesVerifier = qualifyingPropertiesVerifier; + this.qualifPropsUnmarshaller = qualifyingPropsUnmarshaller; + this.rawSigVerifiers = rawSigVerifiers; + this.customSigVerifiers = customSigVerifiers; + } + @Override public XAdESVerificationResult verify(Element signatureElem, SignatureSpecificVerificationOptions verificationOptions) throws XAdES4jException { - // TODO Auto-generated method stub - return null; + if (signatureElem == null) + { + throw new NullPointerException("Signature node not specified"); + } + + if (verificationOptions == null) + { + verificationOptions = SignatureSpecificVerificationOptions.empty; + } + + /* + * Unmarshal XMLdsig (basic XML signature) + */ + XMLSignature signature; + try + { + signature = new XMLSignature(signatureElem, verificationOptions.getBaseUri()); + } catch (XMLSecurityException ex) + { + throw new UnmarshalException("Bad XML signature", ex); + } + + // XMLDsig doesn't require Id, but XAdES does + String signatureId = signature.getId(); + if (null == signatureId) + { + throw new UnmarshalException("XML signature doesn't have an Id"); + } + + // extract references to SignedProperties element and signed data objects + ReferencesRes referencesRes = SignatureUtils.processReferences(signature); + + /* + * Apply early verifiers + */ + RawSignatureVerifierContext rawCtx = new RawSignatureVerifierContext(signature); + for (RawSignatureVerifier rawSignatureVerifier : this.rawSigVerifiers) + { + rawSignatureVerifier.verify(rawCtx); + } + + /* + * Get the QualifyingProperties element and check if it's properly embedded in + * signature (Signature references it and vice versa) + */ + Element qualifyingPropsElem = + SignatureUtils.getQualifyingPropertiesElement(signature); + SignatureUtils.checkSignedPropertiesIncorporation( + qualifyingPropsElem, + referencesRes.signedPropsReference); + SignatureUtils.checkQualifyingPropertiesTarget(signatureId, qualifyingPropsElem); + + /* Unmarshal the qualifying properties */ + QualifPropsDataCollectorImpl propsDataCollector = new QualifPropsDataCollectorImpl(); + qualifPropsUnmarshaller.unmarshalProperties(qualifyingPropsElem, propsDataCollector); + Collection qualifPropsData = propsDataCollector.getPropertiesData(); + + /* there be dragons (that is, wrong, bad, and so-on code)*/ + /* create certification path */ + KeyInfoRes keyInfoRes = SignatureUtils.processKeyInfo(signature.getKeyInfo()); + Date validationDate = getValidationDate(qualifPropsData, signature); + ValidationData certValidationRes = this.certificateValidator.validate( + keyInfoRes.certSelector, + validationDate, + keyInfoRes.keyInfoCerts); + + if (null == certValidationRes || certValidationRes.getCerts().isEmpty()) + { + throw new NullPointerException("Certificate validator returned null or empty data"); + } + X509Certificate validationCert = certValidationRes.getCerts().get(0); + /* Signature verification */ + + // Core XML-DSIG verification. + doCoreVerification(signature, verificationOptions, validationCert); + + // Create the properties verification context. + QualifyingPropertyVerificationContext qPropsCtx = new QualifyingPropertyVerificationContext( + signature, + new QualifyingPropertyVerificationContext.CertificationChainData( + certValidationRes.getCerts(), + certValidationRes.getCrls(), + keyInfoRes.issuerSerial), + /**/ + new QualifyingPropertyVerificationContext.SignedObjectsData( + referencesRes.dataObjsReferences, + signature)); + + // Verify the properties. Data structure verification is included. + Collection props = this.qualifyingPropertiesVerifier.verifyProperties(qualifPropsData, qPropsCtx); + + XAdESVerificationResult res = new XAdESVerificationResult( + XAdESFormChecker.checkForm(props), + signature, + certValidationRes, + qPropsCtx.getAttributeValidationData(), + props, + referencesRes.dataObjsReferences); + + // Apply the custom signature verifiers. + for (CustomSignatureVerifier customVer : this.customSigVerifiers) + { + customVer.verify(res, qPropsCtx); + } + + return res; } @Override @@ -40,16 +202,241 @@ public XAdESVerificationResult verify(Element signatureElem, XadesSignatureFormatExtender formatExtender, XAdESForm finalForm) throws XAdES4jException { - // TODO Auto-generated method stub - return null; + if (null == finalForm || null == formatExtender) + { + throw new NullPointerException("'finalForm' and 'formatExtender' cannot be null"); + } + + // The transitions matrix won't allow this, but this way I avoid the + // unnecessary processing. + if (finalForm.before(XAdESForm.T) || finalForm.after(XAdESForm.X_L)) + { + throw new IllegalArgumentException("Signature format can only be extended to XAdES-T, C, X or X-L"); + } + + XAdESVerificationResult res = this.verify(signatureElem, verificationOptions); + XAdESForm actualForm = res.getSignatureForm(); + + if (actualForm.before(finalForm)) + { + // Valid form transitions: + // * BES/EPES -> T + // * BES/EPES -> C + // * T -> C + // * C -> X + // * C -> X-L + // * X -> X-L (not supported with the library defaults: X cannot be verified) + // * X-L -> A (not supported with the library defaults: X-L cannot be verified) + + FormExtensionPropsCollector finalFormPropsColector = formsExtensionTransitions[actualForm.ordinal()][finalForm.ordinal()]; + + if (null == finalFormPropsColector) + { + throw new InvalidFormExtensionException(actualForm, finalForm); + } + + Collection usp = new ArrayList(3); + finalFormPropsColector.addProps(usp, res); + + formatExtender.enrichSignature(res.getXmlSignature(), new UnsignedProperties(usp)); + } + return res; } // used only for tests - protected XAdESVerificationResult verify(Element signatureNode, Object object, + protected XAdESVerificationResult verify(Element signatureNode, + SignatureSpecificVerificationOptions verificationOptions, XadesSignatureFormatExtender formExt, XAdESForm c, Date date) { // TODO Auto-generated method stub return null; } + private static interface FormExtensionPropsCollector + { + + void addProps(Collection usp, + XAdESVerificationResult res); + } + private static FormExtensionPropsCollector[][] formsExtensionTransitions; + + private static void initFormExtension() + { + XAdESForm[] forms = XAdESForm.values(); + formsExtensionTransitions = new FormExtensionPropsCollector[forms.length][forms.length]; + + // BES/EPES -> T + FormExtensionPropsCollector tPropsCol = new FormExtensionPropsCollector() + { + + @Override + public void addProps( + Collection usp, + XAdESVerificationResult res) + { + PropertiesUtils.addXadesTProperties(usp); + } + }; + formsExtensionTransitions[XAdESForm.BES.ordinal()][XAdESForm.T.ordinal()] = tPropsCol; + formsExtensionTransitions[XAdESForm.EPES.ordinal()][XAdESForm.T.ordinal()] = tPropsCol; + + // BES/EPES -> C + FormExtensionPropsCollector cAndTPropsCol = new FormExtensionPropsCollector() + { + + @Override + public void addProps( + Collection usp, + XAdESVerificationResult res) + { + PropertiesUtils.addXadesCProperties(usp, res.getValidationData()); + PropertiesUtils.addXadesTProperties(usp); + } + }; + formsExtensionTransitions[XAdESForm.BES.ordinal()][XAdESForm.C.ordinal()] = cAndTPropsCol; + formsExtensionTransitions[XAdESForm.EPES.ordinal()][XAdESForm.C.ordinal()] = cAndTPropsCol; + + // T -> C + FormExtensionPropsCollector cPropsCol = new FormExtensionPropsCollector() + { + + @Override + public void addProps( + Collection usp, + XAdESVerificationResult res) + { + PropertiesUtils.addXadesCProperties(usp, res.getValidationData()); + } + }; + formsExtensionTransitions[XAdESForm.T.ordinal()][XAdESForm.C.ordinal()] = cPropsCol; + + // C -> X + FormExtensionPropsCollector xPropsCol = new FormExtensionPropsCollector() + { + + @Override + public void addProps( + Collection usp, + XAdESVerificationResult res) + { + PropertiesUtils.addXadesXProperties(usp); + } + }; + formsExtensionTransitions[XAdESForm.C.ordinal()][XAdESForm.X.ordinal()] = xPropsCol; + + // C -> X-L + FormExtensionPropsCollector xlAndXPropsCol = new FormExtensionPropsCollector() + { + + @Override + public void addProps( + Collection usp, + XAdESVerificationResult res) + { + PropertiesUtils.addXadesXLProperties(usp, res.getValidationData(), + res.getAttributeValidationData()); + PropertiesUtils.addXadesXProperties(usp); + } + }; + formsExtensionTransitions[XAdESForm.C.ordinal()][XAdESForm.X_L.ordinal()] = xlAndXPropsCol; + } + + public void setAcceptUnknownProperties(boolean acceptUnknownProperties) + { + // TODO Auto-generated method stub + + } + + private static void doCoreVerification( + XMLSignature signature, + SignatureSpecificVerificationOptions verificationOptions, + X509Certificate validationCert) throws XAdES4jXMLSigException, InvalidSignatureException + { + List resolvers = verificationOptions.getResolvers(); + if(!CollectionUtils.nullOrEmpty(resolvers)) + { + for (ResourceResolver resolver : resolvers) + { + signature.addResourceResolver(resolver); + } + } + + InputStream nullURIReferenceData = verificationOptions.getDataForAnonymousReference(); + if (nullURIReferenceData != null) + { + signature.addResourceResolver(new ResolverAnonymous(nullURIReferenceData)); + } + + try + { + if (signature.checkSignatureValue(validationCert)) + { + return; + } + } + catch (XMLSignatureException ex) + { + throw new XAdES4jXMLSigException("Error verifying the signature", ex); + } + + try + { + /* Failure due to the signature value or references validation? */ + + if (signature.getSignedInfo().verifyReferences()) + // References are OK; this is a problem on the signature value + // itself. + { + throw new SignatureValueException(signature); + } else + { + // References are NOT OK; get the first invalid Reference. + SignedInfo si = signature.getSignedInfo(); + for (int i = 0; i < si.getLength(); i++) + { + Reference r = si.item(i); + if (!r.verify()) + { + throw new ReferenceValueException(signature, r); + } + } + } + } + catch (XMLSecurityException ex) + { + throw new XAdES4jXMLSigException("Error verifying the references", ex); + } + } + + private Date getValidationDate( + Collection qualifPropsData, + XMLSignature signature) throws XAdES4jException + { + List sigTsData = CollectionUtils.filterByType(qualifPropsData, SignatureTimeStampData.class); + + // If no signature time-stamp is present, use the current date. + if (sigTsData.isEmpty()) + { + return new Date(); + } + + // TODO support multiple SignatureTimeStamps (section 7.3 last paragraph of Standard v.1.4.2) + // This is a temporary solution. + // - Properties should probably be verified in two stages (before and after cert path creation). + // - Had to remove the custom structure verifier that checked if the SigningCertificate data was present. + QualifyingPropertyVerificationContext ctx = new QualifyingPropertyVerificationContext( + signature, + new QualifyingPropertyVerificationContext.CertificationChainData( + new ArrayList(0), + new ArrayList(0), + null), + /**/ + new QualifyingPropertyVerificationContext.SignedObjectsData( + new ArrayList(0), + signature)); + QualifyingProperty sigTs = this.qualifyingPropertiesVerifier.verifyProperties(sigTsData, ctx).iterator().next().getProperty(); + + return ((SignatureTimeStampProperty) sigTs).getTime(); + } + } diff --git a/src/main/java/xades4j/verification/XadesVerificationProfile.java b/src/main/java/xades4j/verification/XadesVerificationProfile.java index 6f013f74..2a31bed6 100644 --- a/src/main/java/xades4j/verification/XadesVerificationProfile.java +++ b/src/main/java/xades4j/verification/XadesVerificationProfile.java @@ -71,7 +71,7 @@ private XadesVerificationProfile() { this.profileCore = new XadesProfileCore(); this.acceptUnknownProperties = false; - withBinding(XadesVerifier.class, XadesVerifierImpl.class); + withBinding(XadesVerifier.class, XadesHybridVerifierImpl.class); } /** @@ -177,7 +177,7 @@ public XadesVerificationProfile withBinding( */ public final XadesVerifier newVerifier() throws XadesProfileResolutionException { - XadesVerifierImpl v = profileCore.getInstance(XadesVerifierImpl.class, overridableModules, sealedModules); + XadesHybridVerifierImpl v = profileCore.getInstance(XadesHybridVerifierImpl.class, overridableModules, sealedModules); v.setAcceptUnknownProperties(acceptUnknownProperties); return v; } From 1e57ae6d0ad2440ba1217b875d1105f15d24637e Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sat, 15 Dec 2012 19:05:33 +0100 Subject: [PATCH 15/84] create hybrid approach unmarshaller default unmarshaller doesn't remember relations between properties and XML nodes, create one that does To make it possible, we need property data collector that can store relationship between property and XML node, add such one Signed-off-by: Tiago Rossi --- .../java/xades4j/utils/PropertiesList.java | 136 +++++++ .../HybridQualifPropsDataCollectorImpl.java | 248 ++++++++++++ .../QualifPropsDataCollectorImpl.java | 9 + .../xades4j/verification/SignatureUtils.java | 14 + .../verification/XadesHybridVerifierImpl.java | 2 +- ...XmlAttrAuthoritiesCertValuesConverter.java | 7 + ...XmlAttributeRevocationValuesConverter.java | 7 + .../FromXmlCertificateValuesConverter.java | 8 + .../FromXmlCompleteCertRefsConverter.java | 6 + .../FromXmlCompleteRevocRefsConverter.java | 13 +- .../FromXmlRevocationValuesConverter.java | 7 + ...ybridQualifyingPropertiesUnmarshaller.java | 361 ++++++++++++++++++ .../QualifyingPropertiesDataCollector.java | 4 + .../UnmarshallingBindingsModule.java | 2 +- 14 files changed, 820 insertions(+), 4 deletions(-) create mode 100644 src/main/java/xades4j/utils/PropertiesList.java create mode 100644 src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java create mode 100644 src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java diff --git a/src/main/java/xades4j/utils/PropertiesList.java b/src/main/java/xades4j/utils/PropertiesList.java new file mode 100644 index 00000000..2fab1d96 --- /dev/null +++ b/src/main/java/xades4j/utils/PropertiesList.java @@ -0,0 +1,136 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.utils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import xades4j.properties.PropertyTargetException; + +/** + * A generic bag of properties used to store properties that apply to a specific target + * (data object descriptions, signature properties collector. + * + * @author Hubert Kario + */ +public class PropertiesList +{ + List properties; + Set> classes; + + /** + * Initializes the property bag with the given number of different initial property + * types. + *

+ * The order in which the properties are added is maintained. + * @param initialNPropTypes the initial number of different property types. + */ + public PropertiesList(int initialNPropTypes) + { + this.properties = new ArrayList(initialNPropTypes); + this.classes = new HashSet>(); + } + + /** + * Puts a property in the bag. The put operation doesn't allow repeated property + * types. If a property of this type was previously added an exception is + * thrown. + * + * @param prop the property + * + * @throws NullPointerException if {@code prop} is {@code null} + * @throws PropertyTargetException if the given property type is already present in + * the bag + */ + public void put(T prop) + { + if (prop == null) + throw new NullPointerException("Property cannot be null"); + + if(classes.contains(prop.getClass())) + throw new PropertyTargetException(String.format( + "A property of type %s was already added", + prop.getClass().getSimpleName())); + + classes.add(prop.getClass()); + properties.add(prop); + } + + /** + * Adds a property to the bag. The add operation allows multiple properties of the + * same type and repeated instances. + * + * @param prop the property + * @throws NullPointerExceptino if {@code prop} is {@code null} + */ + public void add(T prop) + { + if (prop == null) + throw new NullPointerException("Property cannot be null"); + + if (!classes.contains(prop.getClass())) + classes.add(prop.getClass()); + properties.add(prop); + } + + /** + * Removes a property from the bag. + * + * @param prop the property to be removed + * @throws NullPointerException if the property is {@code null} + * @throws IllegalStateException if the property is not present + */ + public void remove(T prop) + { + if (prop == null) + throw new NullPointerException("Property cannot be null"); + + if (!classes.remove(prop.getClass())) + throw new IllegalStateException("Property not present"); + if (!properties.remove(prop)) + throw new IllegalStateException("Property not present"); + } + + /** + * Indicates whatever the bag has any properties + * @return {@code true} if the bag has no properties + */ + public boolean isEmpty() + { + return properties.isEmpty(); + } + + /** + * Gets the properties in the bag + * @return unmodifiable list of properties + */ + public List getProperties() + { + if (properties.isEmpty()) + return Collections.emptyList(); + + return Collections.unmodifiableList(properties); + } + + public int size() + { + return properties.size(); + } +} diff --git a/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java new file mode 100644 index 00000000..f557518e --- /dev/null +++ b/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java @@ -0,0 +1,248 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.util.ArrayList; +import java.util.List; + +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.properties.data.AttributeRevocationValuesData; +import xades4j.properties.data.CertificateValuesData; +import xades4j.properties.data.CommitmentTypeData; +import xades4j.properties.data.CompleteCertificateRefsData; +import xades4j.properties.data.CompleteRevocationRefsData; +import xades4j.properties.data.DataObjectFormatData; +import xades4j.properties.data.GenericDOMData; +import xades4j.properties.data.IndividualDataObjsTimeStampData; +import xades4j.properties.data.OtherPropertyData; +import xades4j.properties.data.PropertyDataObject; +import xades4j.properties.data.RevocationValuesData; +import xades4j.properties.data.SigAndRefsTimeStampData; +import xades4j.properties.data.SignaturePolicyData; +import xades4j.properties.data.SignatureProdPlaceData; +import xades4j.properties.data.SignatureTimeStampData; +import xades4j.properties.data.SignerRoleData; +import xades4j.properties.data.SigningCertificateData; +import xades4j.properties.data.SigningTimeData; +import xades4j.utils.PropertiesList; +import xades4j.utils.PropertiesSet; +import xades4j.xml.unmarshalling.QualifyingPropertiesDataCollector; + +public class HybridQualifPropsDataCollectorImpl implements + QualifyingPropertiesDataCollector +{ + private final PropertiesSet signedSigProperties; + private final PropertiesSet signedDataObjectProperties; + private final PropertiesList unsignedSigProperties; + private final PropertiesList unsignedDataObjectProperties; + private final List unsignedSigPropertiesElements; + + public HybridQualifPropsDataCollectorImpl() + { + signedSigProperties = new PropertiesSet(1); + signedDataObjectProperties = new PropertiesSet(1); + unsignedSigProperties = new PropertiesList(1); + unsignedDataObjectProperties = new PropertiesList(1); + unsignedSigPropertiesElements = new ArrayList(); + } + + @Override + public void setSigningTime(SigningTimeData sigTimeData) + { + signedSigProperties.put(sigTimeData); + } + + @Override + public void setSignatureProdPlace(SignatureProdPlaceData sigProdPlaceData) + { + signedSigProperties.put(sigProdPlaceData); + } + + @Override + public void setSignerRole(SignerRoleData signerRoleData) + { + signedSigProperties.put(signerRoleData); + } + + @Override + public void setSigningCertificate(SigningCertificateData signingCertData) + { + signedSigProperties.put(signingCertData); + } + + @Override + public void setSignaturePolicy(SignaturePolicyData sigPolicyData) + { + signedSigProperties.put(sigPolicyData); + } + + @Override + public void setCompleteCertificateRefs( + CompleteCertificateRefsData completeCertRefsData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.put(completeCertRefsData); + } + + @Override + public void setCompleteRevocRefs( + CompleteRevocationRefsData completeRecovRefsData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.put(completeRecovRefsData); + } + + @Override + public void addSignatureTimeStamp(SignatureTimeStampData sigTSData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.add(sigTSData); + } + + @Override + public void addCommitmentType(CommitmentTypeData commitmentData) + { + signedDataObjectProperties.add(commitmentData); + } + + @Override + public void addDataObjectFormat(DataObjectFormatData formatData) + { + signedDataObjectProperties.add(formatData); + } + + @Override + public void addAllDataObjsTimeStamp(AllDataObjsTimeStampData objsTSData) + { + signedDataObjectProperties.add(objsTSData); + } + + @Override + public void addIndividualDataObjsTimeStamp( + IndividualDataObjsTimeStampData objsTSData) + { + signedDataObjectProperties.add(objsTSData); + } + + @Override + public void addGenericDOMData(GenericDOMData domData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.add(domData); + } + + @Override + public void addOther(OtherPropertyData otherData) + { + unsignedDataObjectProperties.add(otherData); + } + + @Override + public void addSigAndRefsTimeStamp(SigAndRefsTimeStampData tsData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.add(tsData); + } + + @Override + public void setCertificateValues(CertificateValuesData certificateValuesData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.put(certificateValuesData); + } + + @Override + public void setRevocationValues(RevocationValuesData revocationValuesData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.put(revocationValuesData); + } + + @Override + public void setAttrAuthoritiesCertValues( + AttrAuthoritiesCertValuesData attrAuthoritiesCertValuesData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.put(attrAuthoritiesCertValuesData); + } + + @Override + public void setAttributeRevocationValues( + AttributeRevocationValuesData attrRevocValData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.put(attrRevocValData); + } + + List getUnsignedPropertiesData() + { + return unsignedSigProperties.getProperties(); + } + + public List getPropertiesData() + { + List ret = new ArrayList(); + ret.addAll(signedSigProperties.getProperties()); + ret.addAll(signedDataObjectProperties.getProperties()); + ret.addAll(unsignedSigProperties.getProperties()); + ret.addAll(unsignedDataObjectProperties.getProperties()); + return ret; + } + + @Override + public void linkPropertyToElem(Element node) + { + unsignedSigPropertiesElements.add(node); + } + + /** + * Returns XML DOM Node that was parsed from provided PropertyDataObject + * @param pdo + * @return {@code null} if property is not part of UnsignedSignaturePoperties or was + * not present in unmarshalled Signature + */ + public Node getPropertyNode(PropertyDataObject pdo) + { + int index = unsignedSigPropertiesElements.indexOf(pdo); + if (index == -1) + return null; + + return unsignedSigPropertiesElements.get(index); + } +} diff --git a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java index d4214e96..58c9be40 100644 --- a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java @@ -17,6 +17,9 @@ package xades4j.verification; import java.util.Collection; + +import org.w3c.dom.Element; + import xades4j.properties.data.AllDataObjsTimeStampData; import xades4j.properties.data.AttrAuthoritiesCertValuesData; import xades4j.properties.data.AttributeRevocationValuesData; @@ -176,4 +179,10 @@ Collection getPropertiesData() return propsData.getProperties(); } + @Override + public void linkPropertyToElem(Element node) + { + //noop + } + } diff --git a/src/main/java/xades4j/verification/SignatureUtils.java b/src/main/java/xades4j/verification/SignatureUtils.java index c65b813a..1a6822f8 100644 --- a/src/main/java/xades4j/verification/SignatureUtils.java +++ b/src/main/java/xades4j/verification/SignatureUtils.java @@ -158,6 +158,14 @@ static class ReferencesRes } } + /** + * Extracts references to signed properties and signed data objects from provided + * signature. + * @param signature + * @return + * @throws QualifyingPropertiesIncorporationException + * @throws XAdES4jXMLSigException + */ static ReferencesRes processReferences( XMLSignature signature) throws QualifyingPropertiesIncorporationException, XAdES4jXMLSigException { @@ -301,6 +309,12 @@ private static Collection getXAdESChildElements( return xadesElems; } + /** + * Check if signedProperties are properly embedded in qualifying properties element + * @param qualifyingPropsElem + * @param signedPropsRef + * @throws QualifyingPropertiesIncorporationException + */ static void checkSignedPropertiesIncorporation(Element qualifyingPropsElem, Reference signedPropsRef) throws QualifyingPropertiesIncorporationException { Element signedPropsElem = DOMHelper.getFirstChildElement(qualifyingPropsElem); diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java index 78f358f0..cd854080 100644 --- a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -141,7 +141,7 @@ public XAdESVerificationResult verify(Element signatureElem, SignatureUtils.checkQualifyingPropertiesTarget(signatureId, qualifyingPropsElem); /* Unmarshal the qualifying properties */ - QualifPropsDataCollectorImpl propsDataCollector = new QualifPropsDataCollectorImpl(); + HybridQualifPropsDataCollectorImpl propsDataCollector = new HybridQualifPropsDataCollectorImpl(); qualifPropsUnmarshaller.unmarshalProperties(qualifyingPropsElem, propsDataCollector); Collection qualifPropsData = propsDataCollector.getPropertiesData(); diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlAttrAuthoritiesCertValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlAttrAuthoritiesCertValuesConverter.java index c0b41826..b77a71bf 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlAttrAuthoritiesCertValuesConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlAttrAuthoritiesCertValuesConverter.java @@ -35,6 +35,13 @@ public void convertFromObjectTree( throws PropertyUnmarshalException { XmlCertificateValuesType xmlCertificateValues = xmlProps.getAttrAuthoritiesCertValues(); + convertFromObject(xmlCertificateValues, propertyDataCollector); + } + + public void convertFromObject(XmlCertificateValuesType xmlCertificateValues, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { if (null == xmlCertificateValues) return; diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlAttributeRevocationValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlAttributeRevocationValuesConverter.java index c2ad0ca6..755f1e45 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlAttributeRevocationValuesConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlAttributeRevocationValuesConverter.java @@ -34,6 +34,13 @@ public void convertFromObjectTree( throws PropertyUnmarshalException { XmlRevocationValuesType xmlRevocationValues = xmlProps.getAttributeRevocationValues(); + convertFromObject(xmlRevocationValues, propertyDataCollector); + } + + public void convertFromObject(XmlRevocationValuesType xmlRevocationValues, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { if (null == xmlRevocationValues) return; diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlCertificateValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlCertificateValuesConverter.java index a4b2d231..a814ef64 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlCertificateValuesConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlCertificateValuesConverter.java @@ -33,6 +33,14 @@ public void convertFromObjectTree( throws PropertyUnmarshalException { XmlCertificateValuesType xmlCertificateValues = xmlProps.getCertificateValues(); + + convertFromObject(xmlCertificateValues, propertyDataCollector); + } + + public void convertFromObject(XmlCertificateValuesType xmlCertificateValues, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { if (null == xmlCertificateValues) return; diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlCompleteCertRefsConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlCompleteCertRefsConverter.java index f856dc66..a1ef88cb 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlCompleteCertRefsConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlCompleteCertRefsConverter.java @@ -35,6 +35,12 @@ public void convertFromObjectTree( if (null == xmlCompleteCertRefs) return; + convertFromObject(xmlCompleteCertRefs, propertyDataCollector); + } + + public void convertFromObject(XmlCompleteCertificateRefsType xmlCompleteCertRefs, + QualifyingPropertiesDataCollector propertyDataCollector) + { CompleteCertificateRefsData completeCertRefsData = new CompleteCertificateRefsData(); FromXmlUtils.createAndCertificateRefs(xmlCompleteCertRefs.getCertRefs(), completeCertRefsData); diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlCompleteRevocRefsConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlCompleteRevocRefsConverter.java index 587eba36..2b2a7e1a 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlCompleteRevocRefsConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlCompleteRevocRefsConverter.java @@ -40,12 +40,21 @@ public void convertFromObjectTree( if (null == xmlCompleteRevocRefs) return; + convertFromObject(xmlCompleteRevocRefs, propertyDataCollector); + } + + public void convertFromObject(XmlCompleteRevocationRefsType xmlCompleteRevocRefs, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { if (xmlCompleteRevocRefs.getOCSPRefs() != null || xmlCompleteRevocRefs.getOtherRefs() != null) - throw new PropertyUnmarshalException("Only CRL references are supported", CompleteRevocationRefsProperty.PROP_NAME); + throw new PropertyUnmarshalException("Only CRL references are supported", + CompleteRevocationRefsProperty.PROP_NAME); XmlCRLRefsType xmlCRLRefs = xmlCompleteRevocRefs.getCRLRefs(); if (null == xmlCRLRefs) - throw new PropertyUnmarshalException("CRL references not present", CompleteRevocationRefsProperty.PROP_NAME); + throw new PropertyUnmarshalException("CRL references not present", + CompleteRevocationRefsProperty.PROP_NAME); CompleteRevocationRefsData complRevocRefsData = new CompleteRevocationRefsData(); diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java index fadbfd82..5cebf93d 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlRevocationValuesConverter.java @@ -33,6 +33,13 @@ public void convertFromObjectTree( throws PropertyUnmarshalException { XmlRevocationValuesType xmlRevocationValues = xmlProps.getRevocationValues(); + convertFromObject(xmlRevocationValues, propertyDataCollector); + } + + public void convertFromObject(XmlRevocationValuesType xmlRevocationValues, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { if (null == xmlRevocationValues) return; diff --git a/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java b/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java new file mode 100644 index 00000000..2548bb48 --- /dev/null +++ b/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java @@ -0,0 +1,361 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2010 Luis Goncalves. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.unmarshalling; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import xades4j.properties.ArchiveTimeStampProperty; +import xades4j.properties.AttrAuthoritiesCertValuesProperty; +import xades4j.properties.AttributeRevocationValuesProperty; +import xades4j.properties.CertificateValuesProperty; +import xades4j.properties.CompleteCertificateRefsProperty; +import xades4j.properties.CompleteRevocationRefsProperty; +import xades4j.properties.CounterSignatureProperty; +import xades4j.properties.QualifyingProperty; +import xades4j.properties.RevocationValuesProperty; +import xades4j.properties.SigAndRefsTimeStampProperty; +import xades4j.properties.SignatureTimeStampProperty; +import xades4j.properties.UnsignedSignatureProperty; +import xades4j.xml.bind.xades.XmlCertificateValuesType; +import xades4j.xml.bind.xades.XmlCompleteCertificateRefsType; +import xades4j.xml.bind.xades.XmlCompleteRevocationRefsType; +import xades4j.xml.bind.xades.XmlCounterSignatureType; +import xades4j.xml.bind.xades.XmlQualifyingPropertiesType; +import xades4j.xml.bind.xades.XmlRevocationValuesType; +import xades4j.xml.bind.xades.XmlXAdESTimeStampType; + +public final class HybridQualifyingPropertiesUnmarshaller implements + QualifyingPropertiesUnmarshaller +{ + private static final JAXBContext jaxbContext; + private final UnmarshallerModule[] modules; + private boolean acceptUnknown = false; + + static + { + try + { + jaxbContext = JAXBContext.newInstance(XmlQualifyingPropertiesType.class); + } + catch(JAXBException e) + { + throw new UnsupportedOperationException(e); + } + } + + public HybridQualifyingPropertiesUnmarshaller() + { + this.modules = new UnmarshallerModule[3]; + this.modules[0] = new SignedSigPropsModule(); + this.modules[1] = new SignedDataObjPropsModule(); + this.modules[2] = new UnsignedDataObjPropsModule(); + } + + @Override + public void setAcceptUnknownProperties(boolean accept) + { + for (UnmarshallerModule module : modules) + { + module.setAcceptUnknownProperties(accept); + } + acceptUnknown = accept; + } + + @Override + public void unmarshalProperties(Element qualifyingProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws UnmarshalException + { + /* + * Unmarshall SignedSignatureProperties, SignedDataObjectProperties and + * UnsignedDataObjectProperties. + */ + XmlQualifyingPropertiesType xmlQualifyingProps = null; + try + { + // Create the JAXB unmarshaller and unmarshalProperties the root JAXB element + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + JAXBElement qualifPropsElem = + (JAXBElement)unmarshaller.unmarshal(qualifyingProps, + XmlQualifyingPropertiesType.class); + xmlQualifyingProps = qualifPropsElem.getValue(); + } catch (javax.xml.bind.UnmarshalException ex) + { + throw new UnmarshalException("Cannot bind XML elements to Java classes", ex); + } catch (JAXBException ex) + { + throw new UnmarshalException("Cannot unmarshall properties. Error on JAXB unmarshalling.", ex); + } + + // Iterate the modules to convert the different types of properties. + for (UnmarshallerModule module : modules) + { + module.convertProperties(xmlQualifyingProps, qualifyingProps, propertyDataCollector); + } + + /* + * Unmarshall UnsignedSignatureProperties + */ + Element unsignedSignatureProperties = findUnsignedSignaturePropertiesNode(qualifyingProps); + if (unsignedSignatureProperties == null) + return; + + // because the order of properties is important + unmarshalUnsignedSignatureProperties(unsignedSignatureProperties, propertyDataCollector); + } + + private Element findUnsignedSignaturePropertiesNode(Element qualifyingProps) + throws UnmarshalException + { + // find UnsignedProperties element + NodeList qualifyingPropsNodes = qualifyingProps.getChildNodes(); + Element unsignedProperties = null; + for (int i=0; i < qualifyingPropsNodes.getLength(); i++) + { + Node item = qualifyingPropsNodes.item(i); + if (item.getNodeType() != Node.ELEMENT_NODE) + continue; + + Element elem = (Element) item; + if (elem.getLocalName().equalsIgnoreCase(QualifyingProperty.UNSIGNED_PROPS_TAG) + && elem.getNamespaceURI().equals(QualifyingProperty.XADES_XMLNS)) + if (unsignedProperties == null) + unsignedProperties = elem; + else + throw new UnmarshalException("Multiple UnsignedProperties nodes in signature!"); + } + if (unsignedProperties == null) + return null; // no unsigned properties, nothing to unmarshall + + // find UnsignedSignatureProperties element + NodeList unsignedPropsNodes = unsignedProperties.getChildNodes(); + Element unsignedSignatureProperties = null; + for (int i=0; i < unsignedPropsNodes.getLength(); i++) + { + Node item = unsignedPropsNodes.item(i); + if (item.getNodeType() != Node.ELEMENT_NODE) + continue; + + Element elem = (Element) item; + if (elem.getLocalName().equalsIgnoreCase(QualifyingProperty.UNSIGNED_SIGNATURE_PROPS_TAG) + && elem.getNamespaceURI().equals(QualifyingProperty.XADES_XMLNS)) + if (unsignedSignatureProperties == null) + unsignedSignatureProperties = elem; + else + throw new UnmarshalException("Multiple UnsignedSignatureProperties nodes in signature"); + } + if (unsignedSignatureProperties == null) + return null; // no unsigned signature properties, nothing to unmarshall + return unsignedSignatureProperties; + } + + private Node getNextElementNode(Node node) + { + while (node != null && node.getNodeType() != Node.ELEMENT_NODE) + node = node.getNextSibling(); + return node; + } + + private boolean isNodeTheProperty(Node node, Class clazz) + { + Field propNameField; + Field namespaceField; + try { + propNameField = clazz.getField("PROP_NAME"); + if (!clazz.equals(ArchiveTimeStampProperty.class)) // TODO insert Archive version property info + namespaceField = clazz.getField("XADES_XMLNS"); + else + namespaceField = clazz.getField("XADESV141_XMLNS"); + } catch (Exception e) + { + throw new RuntimeException("Wrong class passed to isNodeTheProperty metod", e); + } + String propName; + String namespace; + try { + propName = (String) propNameField.get(null); + namespace = (String) namespaceField.get(null); + } catch (Exception e) + { + throw new RuntimeException("Wrong class passed to isNodeTheProperty metod", e); + } + + if (node.getLocalName().equalsIgnoreCase(propName) && + node.getNamespaceURI().equalsIgnoreCase(namespace)) + return true; + + return false; + } + + + private JAXBElement unmarshallElement(Node node, Class clazz) + throws UnmarshalException + { + JAXBContext jaxbCont = null; + try + { + jaxbCont = JAXBContext.newInstance(clazz); + } catch (JAXBException e) + { + throw new UnmarshalException("JAXB initialization failure", e); + } + JAXBElement unmarshalledElement; + try + { + Unmarshaller unmarshaller = jaxbCont.createUnmarshaller(); + unmarshalledElement = unmarshaller.unmarshal(node, clazz); + } catch (JAXBException e) + { + throw new UnmarshalException( + "Property " + node.getLocalName() + " unmarshalling error", e); + } + return unmarshalledElement; + } + + private void unmarshalUnsignedSignatureProperties(Element unsignedSigProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws UnmarshalException + { + for(Node node = unsignedSigProps.getFirstChild(); node != null; node = node.getNextSibling()) + { + // go past text (line breaks), CDATA, comments, etc. + node = getNextElementNode(node); + if (node == null) + return; + + if (isNodeTheProperty(node, SignatureTimeStampProperty.class)) + { + JAXBElement sigTimeStampElem = + unmarshallElement(node, XmlXAdESTimeStampType.class); + + List xmlSigTimeStamp = new ArrayList(); + xmlSigTimeStamp.add(sigTimeStampElem.getValue()); + FromXmlSignatureTimeStampConverter sigTSConv = new FromXmlSignatureTimeStampConverter(); + + sigTSConv.convertTimeStamps(xmlSigTimeStamp, + propertyDataCollector); + + } else if (isNodeTheProperty(node, CompleteCertificateRefsProperty.class)) + { + JAXBElement completeCertRefsElem = + unmarshallElement(node, XmlCompleteCertificateRefsType.class); + + FromXmlCompleteCertRefsConverter compCertRefsConverter = + new FromXmlCompleteCertRefsConverter(); + + compCertRefsConverter.convertFromObject(completeCertRefsElem.getValue(), + propertyDataCollector); + + } else if (isNodeTheProperty(node, CompleteRevocationRefsProperty.class)) + { + JAXBElement completeRevocRefsElem = + unmarshallElement(node, XmlCompleteRevocationRefsType.class); + + FromXmlCompleteRevocRefsConverter compCertRefsConverter = + new FromXmlCompleteRevocRefsConverter(); + + compCertRefsConverter.convertFromObject(completeRevocRefsElem.getValue(), + propertyDataCollector); + + } else if (isNodeTheProperty(node, SigAndRefsTimeStampProperty.class)) + { + JAXBElement sigAndRefsTimeStampElem = + unmarshallElement(node, XmlXAdESTimeStampType.class); + + List xmlSigAndRefsTimeStamp = new ArrayList(); + xmlSigAndRefsTimeStamp.add(sigAndRefsTimeStampElem.getValue()); + FromXmlSigAndRefsTimeStampConverter sigTSConv = + new FromXmlSigAndRefsTimeStampConverter(); + + sigTSConv.convertTimeStamps(xmlSigAndRefsTimeStamp, + propertyDataCollector); + + } else if (isNodeTheProperty(node, CertificateValuesProperty.class)) + { + JAXBElement certificateValuesElem = + unmarshallElement(node, XmlCertificateValuesType.class); + + FromXmlCertificateValuesConverter certValuesConverter = + new FromXmlCertificateValuesConverter(); + + certValuesConverter.convertFromObject(certificateValuesElem.getValue(), + propertyDataCollector); + + } else if (isNodeTheProperty(node, RevocationValuesProperty.class)) + { + JAXBElement revocationValuesElem = + unmarshallElement(node, XmlRevocationValuesType.class); + + FromXmlRevocationValuesConverter revocValuesConverter = + new FromXmlRevocationValuesConverter(); + + revocValuesConverter.convertFromObject(revocationValuesElem.getValue(), + propertyDataCollector); + + } else if (isNodeTheProperty(node, AttrAuthoritiesCertValuesProperty.class)) + { + + JAXBElement attrAuthCertValElem = + unmarshallElement(node, XmlCertificateValuesType.class); + + FromXmlAttrAuthoritiesCertValuesConverter attrAuthCertValConverter = + new FromXmlAttrAuthoritiesCertValuesConverter(); + + attrAuthCertValConverter.convertFromObject(attrAuthCertValElem.getValue(), + propertyDataCollector); + } else if (isNodeTheProperty(node, AttributeRevocationValuesProperty.class)) + { + JAXBElement revocationValuesElem = + unmarshallElement(node, XmlRevocationValuesType.class); + + FromXmlAttributeRevocationValuesConverter revocValuesConverter = + new FromXmlAttributeRevocationValuesConverter(); + + revocValuesConverter.convertFromObject(revocationValuesElem.getValue(), + propertyDataCollector); + + } else if (isNodeTheProperty(node, CounterSignatureProperty.class)) + { + JAXBElement counterSignatureElem = + unmarshallElement(node, XmlCounterSignatureType.class); + + // TODO counter signature not supported + continue; + + } else if (!acceptUnknown) // not recognized property + throw new UnmarshalException("Unknown unsigned signature property: " + + node.getLocalName()); + else if (acceptUnknown) + continue; + + propertyDataCollector.linkPropertyToElem((Element)node); + + } + } +} diff --git a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java index 4942c5a4..94fa7b37 100644 --- a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java +++ b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java @@ -16,6 +16,8 @@ */ package xades4j.xml.unmarshalling; +import org.w3c.dom.Element; + import xades4j.properties.data.AllDataObjsTimeStampData; import xades4j.properties.data.AttrAuthoritiesCertValuesData; import xades4j.properties.data.AttributeRevocationValuesData; @@ -91,4 +93,6 @@ public void setAttrAuthoritiesCertValues( public void setAttributeRevocationValues( AttributeRevocationValuesData attrRevocValData); + + public void linkPropertyToElem(Element node); } diff --git a/src/main/java/xades4j/xml/unmarshalling/UnmarshallingBindingsModule.java b/src/main/java/xades4j/xml/unmarshalling/UnmarshallingBindingsModule.java index 38619cf9..207457ba 100644 --- a/src/main/java/xades4j/xml/unmarshalling/UnmarshallingBindingsModule.java +++ b/src/main/java/xades4j/xml/unmarshalling/UnmarshallingBindingsModule.java @@ -27,6 +27,6 @@ public final class UnmarshallingBindingsModule extends AbstractModule @Override protected void configure() { - bind(QualifyingPropertiesUnmarshaller.class).to(DefaultQualifyingPropertiesUnmarshaller.class); + bind(QualifyingPropertiesUnmarshaller.class).to(HybridQualifyingPropertiesUnmarshaller.class); } } From 34cfaded51d7c1e5dc97238df6105fa119d7431a Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Thu, 22 Nov 2012 16:02:48 +0100 Subject: [PATCH 16/84] create hybrid verifier default verifier doesn't know how to use the Elements that HybridQualifyingPropertiesUnmarshaller collected, add one that knows how to use them and pass this additional informatino to property verifiers Signed-off-by: Tiago Rossi --- ...ropertiesDataObjectsStructureVerifier.java | 6 ++ .../java/xades4j/utils/PropertiesSet.java | 10 +- .../java/xades4j/utils/PropertiesUtils.java | 4 +- .../verification/CommitmentTypeVerifier.java | 13 ++- .../CompleteCertRefsVerifier.java | 11 +++ .../CompleteRevocRefsVerifier.java | 13 ++- .../CounterSignatureVerifier.java | 8 ++ .../verification/DataObjFormatVerifier.java | 10 ++ .../DefaultVerificationBindingsModule.java | 2 +- .../EncapsulatedPKIDataVerifierBase.java | 11 ++- ...psulatedPKIRevocationDataVerifierBase.java | 10 ++ .../verification/GenericDOMDataVerifier.java | 8 ++ .../HybridQualifPropsDataCollectorImpl.java | 10 +- ...ybridQualifyingPropertiesVerifierImpl.java | 98 +++++++++++++++++++ .../QualifPropsDataCollectorImpl.java | 12 ++- .../QualifyingPropertiesVerifier.java | 16 ++- .../QualifyingPropertiesVerifierImpl.java | 21 +++- .../QualifyingPropertyVerifier.java | 20 ++++ .../verification/SigProdPlaceVerifier.java | 10 ++ .../verification/SignaturePolicyVerifier.java | 11 +++ .../verification/SignerRoleVerifier.java | 10 ++ .../SigningCertificateVerifier.java | 11 +++ .../verification/SigningTimeVerifier.java | 11 +++ .../verification/TimeStampVerifierBase.java | 15 +++ .../verification/XadesHybridVerifierImpl.java | 5 +- .../verification/XadesVerifierImpl.java | 2 +- .../QualifyingPropertiesDataCollector.java | 23 +++++ .../GenericDOMDataVerifierTest.java | 11 +++ .../verification/OtherVerifierTests.java | 19 ++++ 29 files changed, 382 insertions(+), 29 deletions(-) create mode 100644 src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java diff --git a/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java b/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java index d72dd35c..427a496b 100644 --- a/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java +++ b/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java @@ -121,6 +121,12 @@ public void verifiyPropertiesDataStructure( verifiyPropertiesDataStructure(propsData.getDataObjProps()); } + /** + * Checks if internal structure and included parameters of the property are present + * and sane + * @param propsData properties to check + * @throws PropertyDataStructureException + */ public void verifiyPropertiesDataStructure( Collection propsData) throws PropertyDataStructureException { diff --git a/src/main/java/xades4j/utils/PropertiesSet.java b/src/main/java/xades4j/utils/PropertiesSet.java index 29a1f278..f99ba821 100644 --- a/src/main/java/xades4j/utils/PropertiesSet.java +++ b/src/main/java/xades4j/utils/PropertiesSet.java @@ -18,10 +18,10 @@ import xades4j.properties.PropertyTargetException; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; @@ -34,7 +34,7 @@ */ public class PropertiesSet { - private final Map> properties; + private final Map, Set> properties; /** * Initializes the property bag with the given initial diferent property types. @@ -42,7 +42,7 @@ public class PropertiesSet */ public PropertiesSet(int initialNPropTypes) { - this.properties = new HashMap>(initialNPropTypes); + this.properties = new HashMap, Set>(initialNPropTypes); } /** @@ -132,12 +132,12 @@ public boolean isEmpty() * Gets the properties in the bag. * @return un unmodifiable collection of properties */ - public Collection getProperties() + public List getProperties() { if (properties.isEmpty()) return Collections.emptyList(); - Collection props = new ArrayList(properties.size() + 3); + List props = new ArrayList(properties.size() + 3); for (Set propsOfType : properties.values()) { props.addAll(propsOfType); diff --git a/src/main/java/xades4j/utils/PropertiesUtils.java b/src/main/java/xades4j/utils/PropertiesUtils.java index e49c9b36..a7a386b8 100644 --- a/src/main/java/xades4j/utils/PropertiesUtils.java +++ b/src/main/java/xades4j/utils/PropertiesUtils.java @@ -87,8 +87,7 @@ public static void addXadesXLProperties( { usp.add(new CertificateValuesProperty(vData.getCerts())); usp.add(new RevocationValuesProperty(vData.getCrls())); - // TODO add AttrAuthoritiesCertValues - // TODO add AttributeRevocationValues + Collection allTSACerts = new ArrayList(); Collection allTSACRLs = new ArrayList(); for (ValidationData valData : tstValData) @@ -97,7 +96,6 @@ public static void addXadesXLProperties( allTSACRLs.addAll(valData.getCrls()); } usp.add(new AttrAuthoritiesCertValuesProperty(allTSACerts)); - usp.add(new AttributeRevocationValuesProperty(allTSACRLs)); } diff --git a/src/main/java/xades4j/verification/CommitmentTypeVerifier.java b/src/main/java/xades4j/verification/CommitmentTypeVerifier.java index f0b77975..e59e9bfe 100644 --- a/src/main/java/xades4j/verification/CommitmentTypeVerifier.java +++ b/src/main/java/xades4j/verification/CommitmentTypeVerifier.java @@ -17,6 +17,9 @@ package xades4j.verification; import java.util.Collection; + +import org.w3c.dom.Element; + import xades4j.properties.AllDataObjsCommitmentTypeProperty; import xades4j.properties.CommitmentTypeProperty; import xades4j.properties.QualifyingProperty; @@ -41,7 +44,7 @@ public QualifyingProperty verify( { // "Check that all the ObjectReference elements actually reference // ds:Reference elements from the signature." - + SignedObjectsData signedObjsData = ctx.getSignedObjectsData(); CommitmentTypeProperty commitmentTypeProperty = new CommitmentTypeProperty(uri, desc); @@ -58,4 +61,12 @@ public QualifyingProperty verify( } return new AllDataObjsCommitmentTypeProperty(uri, desc); } + + @Override + public QualifyingProperty verify(CommitmentTypeData propData, Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/CompleteCertRefsVerifier.java b/src/main/java/xades4j/verification/CompleteCertRefsVerifier.java index 96922f4d..3ee18742 100644 --- a/src/main/java/xades4j/verification/CompleteCertRefsVerifier.java +++ b/src/main/java/xades4j/verification/CompleteCertRefsVerifier.java @@ -21,6 +21,9 @@ import java.util.Collection; import java.util.Collections; import java.util.List; + +import org.w3c.dom.Element; + import xades4j.properties.CompleteCertificateRefsProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.CertRef; @@ -70,4 +73,12 @@ public QualifyingProperty verify( return new CompleteCertificateRefsProperty(Collections.unmodifiableList(caCerts)); } + + @Override + public QualifyingProperty verify(CompleteCertificateRefsData propData, + Element elem, QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/CompleteRevocRefsVerifier.java b/src/main/java/xades4j/verification/CompleteRevocRefsVerifier.java index 2cfe4766..6c3a6770 100644 --- a/src/main/java/xades4j/verification/CompleteRevocRefsVerifier.java +++ b/src/main/java/xades4j/verification/CompleteRevocRefsVerifier.java @@ -26,6 +26,9 @@ import java.util.Arrays; import java.util.Collection; import javax.security.auth.x500.X500Principal; + +import org.w3c.dom.Element; + import xades4j.properties.CompleteRevocationRefsProperty; import xades4j.properties.QualifyingProperty; import xades4j.UnsupportedAlgorithmException; @@ -74,7 +77,7 @@ public QualifyingProperty verify( if (!crl.getIssuerX500Principal().equals(new X500Principal(crlRef.issuerDN)) || !crl.getThisUpdate().equals(crlRef.issueTime.getTime())) continue; - + try { // Check CRL number, if present. @@ -115,4 +118,12 @@ public QualifyingProperty verify( return new CompleteRevocationRefsProperty(crls); } + + @Override + public QualifyingProperty verify(CompleteRevocationRefsData propData, + Element elem, QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/CounterSignatureVerifier.java b/src/main/java/xades4j/verification/CounterSignatureVerifier.java index 1ab13aed..1dc6ce86 100644 --- a/src/main/java/xades4j/verification/CounterSignatureVerifier.java +++ b/src/main/java/xades4j/verification/CounterSignatureVerifier.java @@ -83,4 +83,12 @@ public QualifyingProperty verify( throw new CounterSignatureVerificationException(e); } } + + @Override + public QualifyingProperty verify(GenericDOMData propData, Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/DataObjFormatVerifier.java b/src/main/java/xades4j/verification/DataObjFormatVerifier.java index 1ab43b15..ddecec40 100644 --- a/src/main/java/xades4j/verification/DataObjFormatVerifier.java +++ b/src/main/java/xades4j/verification/DataObjFormatVerifier.java @@ -19,6 +19,8 @@ import java.util.Collection; import org.apache.xml.security.signature.ObjectContainer; import org.apache.xml.security.signature.Reference; +import org.w3c.dom.Element; + import xades4j.properties.DataObjectFormatProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.DataObjectFormatData; @@ -77,4 +79,12 @@ public QualifyingProperty verify( signedObj.withDataObjectFormat(formatProp); return formatProp; } + + @Override + public QualifyingProperty verify(DataObjectFormatData propData, + Element elem, QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java index 6e729185..04d1aeab 100644 --- a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java +++ b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java @@ -90,7 +90,7 @@ public InputStream getSignaturePolicyDocumentStream( // QualifyingPropertiesVerifier is not configurable but the individual // verifiers may have dependencies. - bind(QualifyingPropertiesVerifier.class).to(QualifyingPropertiesVerifierImpl.class); + bind(QualifyingPropertiesVerifier.class).to(HybridQualifyingPropertiesVerifierImpl.class); bind(QualifyingPropertyVerifiersMapper.class).to(QualifyingPropertyVerifiersMapperImpl.class); // customGlobalStructureVerifiers.add(new CustomPropertiesDataObjsStructureVerifier() diff --git a/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java b/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java index a8dad306..6e079b1a 100644 --- a/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java +++ b/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java @@ -25,7 +25,8 @@ import java.util.Collection; import java.util.List; -import xades4j.properties.CertificateValuesProperty; +import org.w3c.dom.Element; + import xades4j.properties.QualifyingProperty; import xades4j.properties.data.BaseEncapsulatedPKIData; @@ -39,6 +40,14 @@ public EncapsulatedPKIDataVerifierBase(String propName) this.propName = propName; } + public QualifyingProperty verify(BaseEncapsulatedPKIData propData, + Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } + public QualifyingProperty verify(BaseEncapsulatedPKIData propData, QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException diff --git a/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java b/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java index faa229e5..12f6a6c0 100644 --- a/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java +++ b/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java @@ -26,6 +26,8 @@ import java.util.Collection; import java.util.List; +import org.w3c.dom.Element; + import xades4j.properties.QualifyingProperty; import xades4j.properties.data.BaseEncapsulatedPKIData; @@ -39,6 +41,14 @@ public EncapsulatedPKIRevocationDataVerifierBase(String propName) this.propName = propName; } + public QualifyingProperty verify(BaseEncapsulatedPKIData propData, + Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } + public QualifyingProperty verify(BaseEncapsulatedPKIData propData, QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException diff --git a/src/main/java/xades4j/verification/GenericDOMDataVerifier.java b/src/main/java/xades4j/verification/GenericDOMDataVerifier.java index efe63e3d..3f73b8d6 100644 --- a/src/main/java/xades4j/verification/GenericDOMDataVerifier.java +++ b/src/main/java/xades4j/verification/GenericDOMDataVerifier.java @@ -64,4 +64,12 @@ public String getPropertyName() return propVerifier.verify(propData, ctx); } + + @Override + public QualifyingProperty verify(GenericDOMData propData, Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java index f557518e..f67edb56 100644 --- a/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java @@ -215,6 +215,7 @@ List getUnsignedPropertiesData() return unsignedSigProperties.getProperties(); } + @Override public List getPropertiesData() { List ret = new ArrayList(); @@ -231,15 +232,10 @@ public void linkPropertyToElem(Element node) unsignedSigPropertiesElements.add(node); } - /** - * Returns XML DOM Node that was parsed from provided PropertyDataObject - * @param pdo - * @return {@code null} if property is not part of UnsignedSignaturePoperties or was - * not present in unmarshalled Signature - */ + @Override public Node getPropertyNode(PropertyDataObject pdo) { - int index = unsignedSigPropertiesElements.indexOf(pdo); + int index = unsignedSigProperties.getProperties().indexOf(pdo); if (index == -1) return null; diff --git a/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java b/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java new file mode 100644 index 00000000..c6bfb18c --- /dev/null +++ b/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java @@ -0,0 +1,98 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.w3c.dom.Element; + +import com.google.inject.Inject; + +import xades4j.properties.QualifyingProperty; +import xades4j.properties.data.PropertiesDataObjectsStructureVerifier; +import xades4j.properties.data.PropertyDataObject; +import xades4j.properties.data.PropertyDataStructureException; +import xades4j.xml.unmarshalling.QualifyingPropertiesDataCollector; + +public class HybridQualifyingPropertiesVerifierImpl implements + QualifyingPropertiesVerifier +{ + private final QualifyingPropertyVerifiersMapper propertyVerifiersMapper; + private final PropertiesDataObjectsStructureVerifier dataObjectsStructureVerifier; + + @Inject + public HybridQualifyingPropertiesVerifierImpl( + QualifyingPropertyVerifiersMapper propVerMapp, + PropertiesDataObjectsStructureVerifier dataObjStructVerif) + { + propertyVerifiersMapper = propVerMapp; + dataObjectsStructureVerifier = dataObjStructVerif; + } + + @Override + public Collection verifyProperties( + QualifyingPropertiesDataCollector dataCollector, + QualifyingPropertyVerificationContext ctx) + throws PropertyDataStructureException, InvalidPropertyException, + QualifyingPropertyVerifierNotAvailableException + { + /* + * new invocation method (one that knows about XML structure of properties + */ + + // verify internal data structure of properties (presence of mandatory elements + // and sanity of all elements) + List unmarshalledProperties = dataCollector.getPropertiesData(); + dataObjectsStructureVerifier.verifiyPropertiesDataStructure(unmarshalledProperties); + + Collection props = new ArrayList(unmarshalledProperties.size()); + + for (PropertyDataObject propData : unmarshalledProperties) + { + QualifyingPropertyVerifier propVerifier = + this.propertyVerifiersMapper.getVerifier(propData); + Element elem = (Element) dataCollector.getPropertyNode(propData); + QualifyingProperty p = propVerifier.verify(propData, elem, ctx); + if (p == null) + throw new PropertyVerifierErrorException(propData.getClass().getName()); + + props.add(new PropertyInfo(propData, p)); + } + + return Collections.unmodifiableCollection(props); + } + + @Deprecated + @Override + public Collection verifyProperties( + List unmarshalledProperties, + QualifyingPropertyVerificationContext ctx) + throws PropertyDataStructureException, InvalidPropertyException, + QualifyingPropertyVerifierNotAvailableException + { + // old invocation method so use old implementation + QualifyingPropertiesVerifier qpv = new QualifyingPropertiesVerifierImpl( + propertyVerifiersMapper, + dataObjectsStructureVerifier); + + return qpv.verifyProperties(unmarshalledProperties, ctx); + } + +} diff --git a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java index 58c9be40..3fa23ace 100644 --- a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java @@ -16,9 +16,10 @@ */ package xades4j.verification; -import java.util.Collection; +import java.util.List; import org.w3c.dom.Element; +import org.w3c.dom.Node; import xades4j.properties.data.AllDataObjsTimeStampData; import xades4j.properties.data.AttrAuthoritiesCertValuesData; @@ -174,7 +175,7 @@ public void addOther(OtherPropertyData otherData) } /**/ - Collection getPropertiesData() + public List getPropertiesData() { return propsData.getProperties(); } @@ -185,4 +186,11 @@ public void linkPropertyToElem(Element node) //noop } + @Override + public Node getPropertyNode(PropertyDataObject pdo) + { + throw new UnsupportedOperationException("QualifPropsDataCollectorImpl does not"+ + " support getPropertyNode() method. Use HybridQualifPropsDataCollectorImpl."); + } + } diff --git a/src/main/java/xades4j/verification/QualifyingPropertiesVerifier.java b/src/main/java/xades4j/verification/QualifyingPropertiesVerifier.java index 896f966c..4d846a30 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertiesVerifier.java +++ b/src/main/java/xades4j/verification/QualifyingPropertiesVerifier.java @@ -17,8 +17,11 @@ package xades4j.verification; import java.util.Collection; +import java.util.List; + import xades4j.properties.data.PropertyDataObject; import xades4j.properties.data.PropertyDataStructureException; +import xades4j.xml.unmarshalling.QualifyingPropertiesDataCollector; /** * @@ -30,6 +33,17 @@ interface QualifyingPropertiesVerifier * Verifies the data objects' structure and the XAdES rules. */ Collection verifyProperties( - Collection unmarshalledProperties, + QualifyingPropertiesDataCollector unmarshalledProperties, QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, QualifyingPropertyVerifierNotAvailableException; + + /** + * Verifies the data objects' structure and the XAdES rules. + * Use {@link QualifyingPropertiesVerifier#verifyProperties(QualifyingPropertiesDataCollector, QualifyingPropertyVerificationContext)} + * TODO left because legacy parts of verifiers need to verify only some properties, + * for example just SignatureTimeStamp + */ + @Deprecated + Collection verifyProperties( + List unmarshalledProperties, + QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, QualifyingPropertyVerifierNotAvailableException; } diff --git a/src/main/java/xades4j/verification/QualifyingPropertiesVerifierImpl.java b/src/main/java/xades4j/verification/QualifyingPropertiesVerifierImpl.java index 84361635..ea553d63 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertiesVerifierImpl.java +++ b/src/main/java/xades4j/verification/QualifyingPropertiesVerifierImpl.java @@ -20,10 +20,13 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.List; + import xades4j.properties.QualifyingProperty; import xades4j.properties.data.PropertiesDataObjectsStructureVerifier; import xades4j.properties.data.PropertyDataObject; import xades4j.properties.data.PropertyDataStructureException; +import xades4j.xml.unmarshalling.QualifyingPropertiesDataCollector; /** * @@ -45,16 +48,28 @@ class QualifyingPropertiesVerifierImpl implements QualifyingPropertiesVerifier @Override public Collection verifyProperties( - Collection unmarshalledProperties, + QualifyingPropertiesDataCollector dataCollector, QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, QualifyingPropertyVerifierNotAvailableException { + List unmarshalledProperties = dataCollector.getPropertiesData(); + return verifyProperties(unmarshalledProperties, ctx); + } + + @Override + public Collection verifyProperties( + List unmarshalledProperties, + QualifyingPropertyVerificationContext ctx) + throws PropertyDataStructureException, InvalidPropertyException, + QualifyingPropertyVerifierNotAvailableException + { dataObjectsStructureVerifier.verifiyPropertiesDataStructure(unmarshalledProperties); Collection props = new ArrayList(unmarshalledProperties.size()); - + for (PropertyDataObject propData : unmarshalledProperties) { - QualifyingPropertyVerifier propVerifier = this.propertyVerifiersMapper.getVerifier(propData); + QualifyingPropertyVerifier propVerifier = + this.propertyVerifiersMapper.getVerifier(propData); QualifyingProperty p = propVerifier.verify(propData, ctx); if (null == p) diff --git a/src/main/java/xades4j/verification/QualifyingPropertyVerifier.java b/src/main/java/xades4j/verification/QualifyingPropertyVerifier.java index 46628981..768de456 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertyVerifier.java +++ b/src/main/java/xades4j/verification/QualifyingPropertyVerifier.java @@ -16,6 +16,8 @@ */ package xades4j.verification; +import org.w3c.dom.Element; + import xades4j.properties.QualifyingProperty; import xades4j.properties.data.PropertyDataObject; @@ -43,4 +45,22 @@ public interface QualifyingPropertyVerifier public QualifyingProperty verify( TData propData, QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException; + + /** + * Verifies the property data and return the corresponding 'high-level' + * property instance. In case of failure, an exception should be thrown. This + * is done in order to prevent a failure to be undetected by erroneous code. + * Furthermore, the data structures resulting for the verification process + * become simpler. + * + * @param propData the property data + * @param elem the XML element from which the property data originated from + * @param ctx the context with data for validation + * @return the verified QualifyingProperty (never {@code null}) + * @throws InvalidPropertyException (or subclasses) if the property validation fails + */ + public QualifyingProperty verify( + TData propData, + Element elem, + QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException; } diff --git a/src/main/java/xades4j/verification/SigProdPlaceVerifier.java b/src/main/java/xades4j/verification/SigProdPlaceVerifier.java index ece1e4af..b152e6a1 100644 --- a/src/main/java/xades4j/verification/SigProdPlaceVerifier.java +++ b/src/main/java/xades4j/verification/SigProdPlaceVerifier.java @@ -16,6 +16,8 @@ */ package xades4j.verification; +import org.w3c.dom.Element; + import xades4j.properties.QualifyingProperty; import xades4j.properties.SignatureProductionPlaceProperty; import xades4j.properties.data.SignatureProdPlaceData; @@ -37,4 +39,12 @@ public QualifyingProperty verify( propData.getPostalCode(), propData.getCountry()); } + + @Override + public QualifyingProperty verify(SignatureProdPlaceData propData, + Element elem, QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/SignaturePolicyVerifier.java b/src/main/java/xades4j/verification/SignaturePolicyVerifier.java index 8cd753a6..0b39dba7 100644 --- a/src/main/java/xades4j/verification/SignaturePolicyVerifier.java +++ b/src/main/java/xades4j/verification/SignaturePolicyVerifier.java @@ -21,6 +21,9 @@ import java.io.InputStream; import java.security.MessageDigest; import java.util.Arrays; + +import org.w3c.dom.Element; + import xades4j.properties.ObjectIdentifier; import xades4j.properties.QualifyingProperty; import xades4j.properties.SignaturePolicyIdentifierProperty; @@ -97,4 +100,12 @@ public QualifyingProperty verify( } } } + + @Override + public QualifyingProperty verify(SignaturePolicyData propData, + Element elem, QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/SignerRoleVerifier.java b/src/main/java/xades4j/verification/SignerRoleVerifier.java index 31597caf..fbb59c57 100644 --- a/src/main/java/xades4j/verification/SignerRoleVerifier.java +++ b/src/main/java/xades4j/verification/SignerRoleVerifier.java @@ -16,6 +16,8 @@ */ package xades4j.verification; +import org.w3c.dom.Element; + import xades4j.properties.QualifyingProperty; import xades4j.properties.SignerRoleProperty; import xades4j.properties.data.SignerRoleData; @@ -33,4 +35,12 @@ public QualifyingProperty verify( { return new SignerRoleProperty(propData.getClaimedRoles()); } + + @Override + public QualifyingProperty verify(SignerRoleData propData, Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/SigningCertificateVerifier.java b/src/main/java/xades4j/verification/SigningCertificateVerifier.java index 308e3e25..f17b2ec4 100644 --- a/src/main/java/xades4j/verification/SigningCertificateVerifier.java +++ b/src/main/java/xades4j/verification/SigningCertificateVerifier.java @@ -21,6 +21,9 @@ import java.util.Collection; import java.util.Iterator; import javax.security.auth.x500.X500Principal; + +import org.w3c.dom.Element; + import xades4j.properties.QualifyingProperty; import xades4j.properties.SigningCertificateProperty; import xades4j.properties.data.CertRef; @@ -114,4 +117,12 @@ public QualifyingProperty verify( return new SigningCertificateProperty(certChainData.getCertificateChain()); } + + @Override + public QualifyingProperty verify(SigningCertificateData propData, + Element elem, QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/SigningTimeVerifier.java b/src/main/java/xades4j/verification/SigningTimeVerifier.java index a4172e1a..dcfd3c25 100644 --- a/src/main/java/xades4j/verification/SigningTimeVerifier.java +++ b/src/main/java/xades4j/verification/SigningTimeVerifier.java @@ -17,6 +17,9 @@ package xades4j.verification; import java.util.Date; + +import org.w3c.dom.Element; + import xades4j.properties.QualifyingProperty; import xades4j.properties.SigningTimeProperty; import xades4j.properties.data.SigningTimeData; @@ -37,4 +40,12 @@ public QualifyingProperty verify( throw new SigningTimeVerificationException(sigTime, now); return new SigningTimeProperty(propData.getSigningTime()); } + + @Override + public QualifyingProperty verify(SigningTimeData propData, Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/main/java/xades4j/verification/TimeStampVerifierBase.java b/src/main/java/xades4j/verification/TimeStampVerifierBase.java index d0f9daca..dfa9f9ca 100644 --- a/src/main/java/xades4j/verification/TimeStampVerifierBase.java +++ b/src/main/java/xades4j/verification/TimeStampVerifierBase.java @@ -19,6 +19,9 @@ import java.lang.reflect.Method; import java.util.Date; import java.util.List; + +import org.w3c.dom.Element; + import xades4j.UnsupportedAlgorithmException; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.BaseXAdESTimeStampData; @@ -52,6 +55,16 @@ public TimeStampVerifierBase(TimeStampVerificationProvider tsVerifier, TimeStamp @Override public final QualifyingProperty verify( TData propData, + Element elem, + QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException + { + // TODO check order of Elements in signature (literal XML), probably in addPropSpecificTimeStampInput() + return verify(propData, ctx); + } + + @Override + public final QualifyingProperty verify( + TData propData, QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException { try @@ -121,6 +134,8 @@ private static TimeStampVerificationException getEx( return new TimeStampVerificationException(propName, ex) { + private static final long serialVersionUID = 1L; + @Override protected String getVerificationMessage() { diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java index cd854080..58632451 100644 --- a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -177,7 +177,7 @@ public XAdESVerificationResult verify(Element signatureElem, signature)); // Verify the properties. Data structure verification is included. - Collection props = this.qualifyingPropertiesVerifier.verifyProperties(qualifPropsData, qPropsCtx); + Collection props = this.qualifyingPropertiesVerifier.verifyProperties(propsDataCollector, qPropsCtx); XAdESVerificationResult res = new XAdESVerificationResult( XAdESFormChecker.checkForm(props), @@ -343,8 +343,7 @@ public void addProps( public void setAcceptUnknownProperties(boolean acceptUnknownProperties) { - // TODO Auto-generated method stub - + this.qualifPropsUnmarshaller.setAcceptUnknownProperties(acceptUnknownProperties); } private static void doCoreVerification( diff --git a/src/main/java/xades4j/verification/XadesVerifierImpl.java b/src/main/java/xades4j/verification/XadesVerifierImpl.java index 4861e715..17ebaf3f 100644 --- a/src/main/java/xades4j/verification/XadesVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesVerifierImpl.java @@ -211,7 +211,7 @@ public XAdESVerificationResult verify(Element signatureElem, SignatureSpecificVe signature)); // Verify the properties. Data structure verification is included. - Collection props = this.qualifyingPropertiesVerifier.verifyProperties(qualifPropsData, qPropsCtx); + Collection props = this.qualifyingPropertiesVerifier.verifyProperties(propsDataCollector, qPropsCtx); XAdESVerificationResult res = new XAdESVerificationResult( XAdESFormChecker.checkForm(props), diff --git a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java index 94fa7b37..caaf9c7c 100644 --- a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java +++ b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java @@ -16,12 +16,16 @@ */ package xades4j.xml.unmarshalling; +import java.util.List; + import org.w3c.dom.Element; +import org.w3c.dom.Node; import xades4j.properties.data.AllDataObjsTimeStampData; import xades4j.properties.data.AttrAuthoritiesCertValuesData; import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; +import xades4j.properties.data.PropertyDataObject; import xades4j.properties.data.RevocationValuesData; import xades4j.properties.data.SigAndRefsTimeStampData; import xades4j.properties.data.SigningTimeData; @@ -95,4 +99,23 @@ public void setAttributeRevocationValues( AttributeRevocationValuesData attrRevocValData); public void linkPropertyToElem(Element node); + + /** + * return all properties in Signature in following order: + * SignedSignatureProperties, SignedDataObjectProperties, UnsignedSignatureProperties + * and UnsignedDataObjectProperties. + *

+ * Properties in each of the groups are returned in order in which they are present + * in Signature + * @return + */ + public List getPropertiesData(); + + /** + * Returns XML DOM Node that was parsed to from provided PropertyDataObject + * @param pdo + * @return {@code null} if property is not part of UnsignedSignaturePoperties or was + * not present in unmarshalled Signature + */ + public Node getPropertyNode(PropertyDataObject pdo); } diff --git a/src/test/java/xades4j/verification/GenericDOMDataVerifierTest.java b/src/test/java/xades4j/verification/GenericDOMDataVerifierTest.java index f7da86ea..0c643b26 100644 --- a/src/test/java/xades4j/verification/GenericDOMDataVerifierTest.java +++ b/src/test/java/xades4j/verification/GenericDOMDataVerifierTest.java @@ -26,6 +26,8 @@ import org.junit.BeforeClass; import org.junit.Test; import org.w3c.dom.Document; +import org.w3c.dom.Element; + import static org.junit.Assert.*; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.GenericDOMData; @@ -119,4 +121,13 @@ public String getName() } }; } + + @Override + public QualifyingProperty verify(GenericDOMData propData, + Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } } diff --git a/src/test/java/xades4j/verification/OtherVerifierTests.java b/src/test/java/xades4j/verification/OtherVerifierTests.java index 85ff9f94..dd4872d0 100644 --- a/src/test/java/xades4j/verification/OtherVerifierTests.java +++ b/src/test/java/xades4j/verification/OtherVerifierTests.java @@ -22,6 +22,7 @@ import xades4j.properties.QualifyingProperty; import xades4j.properties.data.SigningTimeData; import org.junit.Test; +import org.w3c.dom.Element; class SigningTimeVerifierThatDependsOnBuiltInVerifier implements QualifyingPropertyVerifier { @@ -40,6 +41,15 @@ public QualifyingProperty verify(SigningTimeData propData, QualifyingPropertyVer builtInVerifier.verify(propData, ctx); throw new SigningTimeVerificationException(null, null); } + + @Override + public QualifyingProperty verify(SigningTimeData propData, Element elem, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + builtInVerifier.verify(propData, ctx); + throw new SigningTimeVerificationException(null, null); + } } /** @@ -72,6 +82,15 @@ public QualifyingProperty verify( { throw new UnsupportedOperationException("Yeah!"); } + + @Override + public QualifyingProperty verify(SigningTimeData propData, + Element elem, QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + throw new UnsupportedOperationException("Yeah!"); + + } }); verifySignature("document.signed.bes.xml", mySigsVerificationProfile); } From 300677b46efb211f0c7ed1ca4dd2eb29ae6d9df0 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Thu, 22 Nov 2012 19:47:33 +0100 Subject: [PATCH 17/84] provide XML location information to TimeStampVerifiers SigAndRefsTimeStamp must take properties in the order of appearence within the signature. Previous mechanism used deterministic algorithm to put properties in specific order. Signed-off-by: Tiago Rossi --- .../AllDataObjsTimeStampVerifier.java | 10 +- .../IndivDataObjsTimeStampVerifier.java | 3 + .../SigAndRefsTimeStampVerifier.java | 240 +++++++++++++----- .../SignatureTimeStampVerifier.java | 1 + .../verification/TimeStampVerifierBase.java | 24 +- 5 files changed, 206 insertions(+), 72 deletions(-) diff --git a/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java b/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java index 1932efaa..903bed2c 100644 --- a/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java @@ -18,6 +18,9 @@ import com.google.inject.Inject; import java.util.Collection; + +import org.w3c.dom.Element; + import xades4j.properties.AllDataObjsTimeStampProperty; import xades4j.utils.CannotAddDataToDigestInputException; import xades4j.properties.QualifyingProperty; @@ -42,7 +45,12 @@ public AllDataObjsTimeStampVerifier( } @Override - protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty(AllDataObjsTimeStampData propData, TimeStampDigestInput digestInput, QualifyingPropertyVerificationContext ctx) throws CannotAddDataToDigestInputException + protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + AllDataObjsTimeStampData propData, + Element location, + TimeStampDigestInput digestInput, + QualifyingPropertyVerificationContext ctx) + throws CannotAddDataToDigestInputException { Collection dataObjs = ctx.getSignedObjectsData().getAllDataObjects(); diff --git a/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java b/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java index c7001d02..a5a0de66 100644 --- a/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java @@ -16,6 +16,8 @@ */ package xades4j.verification; +import org.w3c.dom.Element; + import com.google.inject.Inject; import xades4j.utils.CannotAddDataToDigestInputException; import xades4j.properties.IndividualDataObjsTimeStampProperty; @@ -43,6 +45,7 @@ public IndivDataObjsTimeStampVerifier( @Override protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( IndividualDataObjsTimeStampData propData, + Element location, TimeStampDigestInput digestInput, QualifyingPropertyVerificationContext ctx) throws CannotAddDataToDigestInputException, TimeStampVerificationException { diff --git a/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java b/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java index 86dc11b8..fb957ad1 100644 --- a/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java @@ -54,77 +54,195 @@ public SigAndRefsTimeStampVerifier( @Override protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( - SigAndRefsTimeStampData propData, TimeStampDigestInput digestInput, + SigAndRefsTimeStampData propData, Element location, + TimeStampDigestInput digestInput, QualifyingPropertyVerificationContext ctx) throws CannotAddDataToDigestInputException, TimeStampVerificationException { - /* - * "Take each one of the signed properties and not property elements in the - * signature that the normative part dictates that must be time-stamped, in the - * order specified in the normative clause defining the time-stamp token - * container type. Canonicalize them and concatenate the resulting bytes in one - * octet stream. If the CanonicalizationMethod element of the property is - * present, use it for canonicalizing. Otherwise, use the standard - * canonicalization method as specified by XMLDSIG." - */ - // TimeStamp is taken over SignatureValue element - Element sigValueElem = DOMHelper.getFirstDescendant( - ctx.getSignature().getElement(), - Constants.SignatureSpecNS, + Element sigValueElem = DOMHelper.getFirstDescendant(ctx.getSignature() + .getElement(), Constants.SignatureSpecNS, Constants._TAG_SIGNATUREVALUE); digestInput.addNode(sigValueElem); - // next elements that should have been timestamped are all SignatureTimeStamps - // there may be no SignatureTimeStamps - // TODO write test for document with SigAndRefsTimeStamp but no SignatureTimeStamp - NodeList signatureTimeStamps = ctx.getSignature().getElement().getElementsByTagNameNS( - SignatureTimeStampProperty.XADES_XMLNS, - SignatureTimeStampProperty.PROP_NAME); - for (int i=0; i < signatureTimeStamps.getLength(); i++) + /* + * "Take each one of the signed properties and not property elements in + * the signature that the normative part dictates that must be + * time-stamped, in the order specified in the normative clause defining + * the time-stamp token container type. Canonicalize them and + * concatenate the resulting bytes in one octet stream. If the + * CanonicalizationMethod element of the property is present, use it for + * canonicalizing. Otherwise, use the standard canonicalization method + * as specified by XMLDSIG." + * + * XAdES 1.4.2, section G.2.2.16.2.3, Implicit mechanism: " + * 1) In step 4) the verifier should check that the CompleteCertificateRefs and + * CompleteRevocationRefs properties are present in the signature. She + * should also check that they and, if present, SignatureTimeStamp, + * AttributeCertificateRefs and AttributeRevocationRefs, appear before + * SigAndRefsTimeStamp. + * 2) In step 5), the verifier should take the aforementioned properties in + * their order of appearance within the signature." + */ + + if (location == null) // use fallback mechanism { - Element timeStampElem = (Element) signatureTimeStamps.item(i); - digestInput.addNode(timeStampElem); - } + // XXX legacy code, to be removed when whole library is using new + // hybrid verifier + + // next elements that should have been timestamped are all + // SignatureTimeStamps + // there may be no SignatureTimeStamps + NodeList signatureTimeStamps = ctx + .getSignature() + .getElement() + .getElementsByTagNameNS( + SignatureTimeStampProperty.XADES_XMLNS, + SignatureTimeStampProperty.PROP_NAME); + for (int i = 0; i < signatureTimeStamps.getLength(); i++) + { + Element timeStampElem = (Element) signatureTimeStamps.item(i); + digestInput.addNode(timeStampElem); + } + + // then CompleteCertificateRefs + Element completeCertificateRefsElem = DOMHelper.getFirstDescendant( + ctx.getSignature().getElement(), + CompleteCertificateRefsProperty.XADES_XMLNS, + CompleteCertificateRefsProperty.PROP_NAME); + digestInput.addNode(completeCertificateRefsElem); + + // ...and CompleteRevocationRefs + Element completeRevocationRefsElem = DOMHelper.getFirstDescendant( + ctx.getSignature().getElement(), + CompleteRevocationRefsProperty.XADES_XMLNS, + CompleteRevocationRefsProperty.PROP_NAME); + digestInput.addNode(completeRevocationRefsElem); + + // AttributeCertificateRefs are optional + Element attributeCertificateRefs = DOMHelper.getFirstDescendant(ctx + .getSignature().getElement(), + CompleteRevocationRefsProperty.XADES_XMLNS, + "AttributeCertificateRefs"); + if (attributeCertificateRefs != null) + throw new CannotAddDataToDigestInputException(new Exception( + "Can't verify SigAndRefsTimeStamp: " + + "AttributeCertificateRefs is unsupported")); + + // AttributeRevocationRefs are optional + Element attributeRevocationRefs = DOMHelper.getFirstDescendant(ctx + .getSignature().getElement(), + CompleteRevocationRefsProperty.XADES_XMLNS, + "AttributeRevocationRefs"); + if (attributeRevocationRefs != null) + throw new CannotAddDataToDigestInputException(new Exception( + "Can't verify SigAndRefsTimeStamp: " + + "AttributeRevocationRefs is unsupported")); - // then CompleteCertificateRefs - Element completeCertificateRefsElem = DOMHelper.getFirstDescendant( - ctx.getSignature().getElement(), - CompleteCertificateRefsProperty.XADES_XMLNS, - CompleteCertificateRefsProperty.PROP_NAME); - digestInput.addNode(completeCertificateRefsElem); - - // ...and CompleteRevocationRefs - Element completeRevocationRefsElem = DOMHelper.getFirstDescendant( - ctx.getSignature().getElement(), - CompleteRevocationRefsProperty.XADES_XMLNS, - CompleteRevocationRefsProperty.PROP_NAME); - digestInput.addNode(completeRevocationRefsElem); - - // AttributeCertificateRefs are optional - // TODO implement missing classes - Element attributeCertificateRefs = DOMHelper.getFirstDescendant( - ctx.getSignature().getElement(), - CompleteRevocationRefsProperty.XADES_XMLNS, - "AttributeCertificateRefs"); - if (attributeCertificateRefs != null) - throw new CannotAddDataToDigestInputException( - new Exception("Can't verify SigAndRefsTimeStamp: " + - "AttributeCertificateRefs is unsupported")); - - // AttributeRevocationRefs are optional - // TODO implement missing classes - Element attributeRevocationRefs = DOMHelper.getFirstDescendant( - ctx.getSignature().getElement(), - CompleteRevocationRefsProperty.XADES_XMLNS, - "AttributeRevocationRefs"); - if (attributeRevocationRefs != null) - throw new CannotAddDataToDigestInputException( - new Exception("Can't verify SigAndRefsTimeStamp: " + - "AttributeRevocationRefs is unsupported")); - - return new SigAndRefsTimeStampProperty(); + return new SigAndRefsTimeStampProperty(); + } else { + // TODO write test for document with SigAndRefsTimeStamp but no + // SignatureTimeStamp + + // remember whatever we found mandatory elements + boolean foundCompleteRevocRefs = false; + boolean foundCompleteCertRefs = false; + + // iterate over elements in order in which they are present in XML + for (Element elem = DOMHelper.getFirstChildElement(location + .getParentNode()); elem != location; elem = DOMHelper + .getNextSiblingElement(elem)) + { + if (isElementMatchingProperty(elem, + SignatureTimeStampProperty.class)) + { + // there are no specific requirements for SignatureTimeStamp + // so just add them + digestInput.addNode(elem); + // TODO check if there are no SignatureTimestamps *after* + // SigAndRefsTimeStamp + } else if (isElementMatchingProperty(elem, + CompleteCertificateRefsProperty.class)) + { + // there must be exactly one CompleteCertificateRefs element + if (foundCompleteCertRefs) + throw new CannotAddDataToDigestInputException( + new Exception( + "Duplicate CompleteCertificateRefs property" + + " in Signature")); + foundCompleteCertRefs = true; + digestInput.addNode(elem); + // TODO check if there are no CompleteCertificateRefs + // *after* SigAndRefsTimeStamp + } else if (isElementMatchingProperty(elem, + CompleteRevocationRefsProperty.class)) + { + // there must be exactly one CompleteRevocationRefs element + if (foundCompleteRevocRefs) + throw new CannotAddDataToDigestInputException( + new Exception( + "Duplicate CompleteRevocationRefs property" + + " in Singature")); + foundCompleteRevocRefs = true; + digestInput.addNode(elem); + // TODO check if there are no CompleteRevocationRefs *after* + // SigAndRefsTimeStamp + } else if (elem.getLocalName().equalsIgnoreCase( + "AttributeCertificateRefs") + && elem.getNamespaceURI().equalsIgnoreCase( + QualifyingProperty.XADES_XMLNS)) + { + // TODO implement AttributeCertificateRefs support + throw new CannotAddDataToDigestInputException( + new Exception("Can't verify SigAndRefsTimeStamp: " + + "AttributeCertificateRefs is unsupported")); + } else if (elem.getLocalName().equalsIgnoreCase( + "AttributeRevocationRefs") + && elem.getNamespaceURI().equalsIgnoreCase( + QualifyingProperty.XADES_XMLNS)) + { + // TODO implement AttributeRevocationRefs support + throw new CannotAddDataToDigestInputException( + new Exception("Can't verify SigAndRefsTimeStamp: " + + "AttributeRevocationRefs is unsupported")); + } // else: ignore other properties + } + + if (foundCompleteRevocRefs && foundCompleteCertRefs) + return new SigAndRefsTimeStampProperty(); + else + throw new CannotAddDataToDigestInputException(new Exception( + "Missing mandatory properties: CompleteCertificateRefs" + + " or CompleteRevocationRefs")); + } } + private boolean isElementMatchingProperty(Element elem, + Class prop) + { + try + { + return elem.getLocalName().equalsIgnoreCase( + (String) prop.getField("PROP_NAME").get(null)) + && elem.getNamespaceURI().equalsIgnoreCase( + (String) prop.getField("XADES_XMLNS").get(null)); + } catch (IllegalArgumentException e) + { + e.printStackTrace(); + throw new InternalError("Wrong property class"); + } catch (SecurityException e) + { + e.printStackTrace(); + throw new InternalError("Wrong property class"); + } catch (IllegalAccessException e) + { + e.printStackTrace(); + throw new InternalError("Wrong property class"); + } catch (NoSuchFieldException e) + { + e.printStackTrace(); + throw new InternalError("Wrong property class"); + } + } } diff --git a/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java b/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java index 414121d4..33760dbe 100644 --- a/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java @@ -45,6 +45,7 @@ public SignatureTimeStampVerifier( @Override protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( SignatureTimeStampData propData, + Element location, TimeStampDigestInput digestInput, QualifyingPropertyVerificationContext ctx) throws CannotAddDataToDigestInputException { diff --git a/src/main/java/xades4j/verification/TimeStampVerifierBase.java b/src/main/java/xades4j/verification/TimeStampVerifierBase.java index dfa9f9ca..80b323c9 100644 --- a/src/main/java/xades4j/verification/TimeStampVerifierBase.java +++ b/src/main/java/xades4j/verification/TimeStampVerifierBase.java @@ -58,20 +58,15 @@ public final QualifyingProperty verify( Element elem, QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException { - // TODO check order of Elements in signature (literal XML), probably in addPropSpecificTimeStampInput() - return verify(propData, ctx); - } - - @Override - public final QualifyingProperty verify( - TData propData, - QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException - { try { TimeStampDigestInput digestInput = this.tsInputFactory.newTimeStampDigestInput(propData.getCanonicalizationAlgorithm()); - QualifyingProperty prop = addPropSpecificTimeStampInputAndCreateProperty(propData, digestInput, ctx); + QualifyingProperty prop = addPropSpecificTimeStampInputAndCreateProperty( + propData, + elem, + digestInput, + ctx); byte[] data = digestInput.getBytes(); /** * Verify the time-stamp tokens on a time-stamp property data object. All @@ -108,8 +103,17 @@ public final QualifyingProperty verify( } } + @Override + public final QualifyingProperty verify( + TData propData, + QualifyingPropertyVerificationContext ctx) throws InvalidPropertyException + { + return verify(propData, null, ctx); + } + protected abstract QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( TData propData, + Element location, TimeStampDigestInput digestInput, QualifyingPropertyVerificationContext ctx) throws CannotAddDataToDigestInputException, TimeStampVerificationException; From 57515b7915779b095fc23d4ce1ffcaa23cd300ee Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Thu, 6 Dec 2012 19:06:29 +0100 Subject: [PATCH 18/84] constraints on time stamps, certificates and CRLs Signed-off-by: Tiago Rossi --- ...ontraints on CRLs timestamps and certs.txt | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 time contraints on CRLs timestamps and certs.txt diff --git a/time contraints on CRLs timestamps and certs.txt b/time contraints on CRLs timestamps and certs.txt new file mode 100644 index 00000000..37622c64 --- /dev/null +++ b/time contraints on CRLs timestamps and certs.txt @@ -0,0 +1,51 @@ +# +# specific to XAdES-C, XAdES-X and forms that are based on them +# + +# certificate should be valid before usage +CompleteCertificateRefs.notBeforeDate < min(SignatureTimeStamp, SigAndRefsTimeStamp, ArchiveTimeStamp) +# for signature to be valid certificate has to be used before its revocation +min(SignatureTimeStamp, SigAndRefsTimeStamp, ArchiveTimeStamp) < CompleteCertificateRefs.revocationDate +# for signature to be valid certificate has to be used before end of its validity +min(SignatureTimeStamp, SigAndRefsTimeStamp, ArchiveTimeStamp) < CompleteCertificateRefs.notAfterDate +# CRLs for signing certificate should be published after signing took place +min(SignatureTimeStamp, SigAndRefsTimeStamp, ArchiveTimeStamp) + gracePeriod "should be" < CompleteRevocationRefs.thisUpdate +# CRL has to be published before certificate validity end +CompleteRevocationRefs.thisUpdate < CompleteCertificateRefs.notAfterDate +# CRL must be valid for the time it was used +min(SignatureTimeStamp, SigAndRefsTimeStamp, ArchiveTimeStamp) < CompleteRevocationRefs.nextUpdate +# SignatureTimeStamp TSA certificate must be used before its validity end +min(SigAndRefsTimeStamp, ArchiveTimeStamp) < AttributeCertificateRefs.notBeforeDate +# SignatureTimeStamp TSA certificate must be used before its revocation +min(SigAndRefsTimeStamp, ArchiveTimeStamp) < AttributeCertificateRefs.revocationDate +# SignatureTimeStamp TSA must be used before its validity end +AttributeCertificateRefs.notAfterDate < min(SigAndRefsTimeStamp, ArchiveTimeStamp) +# CRLs for TSA cert should be published after SignatureTimeStamp creation took place +min(SigAndRefsTimeStamp, ArchiveTimeStamp) + gracePeriod "should be " < AttributeRevocationRefs.thisUpdate +# CRLs for TSA cert should be valid at the time the checking takes place +min(SigAndRefsTimeStamp, ArchiveTimeStamp) < AttributeRevocationRefs.nextUpdate +# signing certificate can be used after its validity starts +CompleteCertificateRefs.notBeforeDate < SigAndRefsTimeStamp +# signature CRLs have to be published before second time stamping +CompleteRevocationRefs.thisUpdate < SigAndRefsTimeStamp + +# +# specific to XAdES-X-L and XAdES-A +# + +# signature certificate can be used only after its validity starts +CertificateValues.notBeforeDate < ArchiveTimeStamp +# signature CRLs must be created before archive time stamp +RevocationValues.thisUpdate < ArchiveTimeStamp +# SignatureTimeStamp and SigAndRefsTimeStamp TSA can be used only after their validity starts +AttrAuthoritiesCertValues.notBeforeDate < ArchiveTimeStamp +# SignatureTimeStamp or SigAndRefsTimeStamp TSA can be used only if they are still valid +ArchiveTimeStamp < AttrAuthoritiesCertValues.notAfterDate +# CRLs for Signature should be published after SignatureTimeStamp or SigAndRefsTimeStamp +min(SignatureTimeStamp, SigAndRefsTimeStamp) + gracePeriod "should be" < RevocationValues.thisUpdate + +# +# all forms (any property may be omitted) +# +# time stamps should be monotonic +SignatureTimeStamp < SigAndRefsTimeStamp < ArchiveTimeStamp From 257c457eb487c030e4c2c872b88d71b653353379 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Thu, 13 Dec 2012 21:12:35 +0100 Subject: [PATCH 19/84] allow for creation of C form from T form with current CRLs Sun X509CRLSelector doesn't return CRLs that were published "in future", but to properly validate signature we have to use time from earliest valid time stamp implement custom CRLSelector that returns usable CRLs Signed-off-by: Tiago Rossi --- ...PKIXCertificateValidationProviderBase.java | 82 ++++++++++++++----- 1 file changed, 61 insertions(+), 21 deletions(-) diff --git a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java index e3b6d60e..e8ca839e 100644 --- a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java +++ b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java @@ -23,6 +23,8 @@ import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.PublicKey; +import java.security.cert.CRL; +import java.security.cert.CRLSelector; import java.security.cert.CertPathBuilder; import java.security.cert.CertPathBuilderException; import java.security.cert.CertStore; @@ -32,7 +34,6 @@ import java.security.cert.PKIXBuilderParameters; import java.security.cert.PKIXCertPathBuilderResult; import java.security.cert.X509CRL; -import java.security.cert.X509CRLSelector; import java.security.cert.X509CertSelector; import java.security.cert.X509Certificate; import java.util.ArrayList; @@ -203,30 +204,28 @@ private Collection getCRLsForCertPath( issuersCerts.put(certPath.get(i).getIssuerX500Principal(), certPath.get(i + 1)); } - // Select all the CRLs from the issuers involved in the certification path - // that are valid at the moment. - X509CRLSelector crlSelector = new X509CRLSelector(); - for (X500Principal issuer : issuersCerts.keySet()) - { - // - "The issuer distinguished name in the X509CRL must match at least - // one of the specified distinguished names." - crlSelector.addIssuer(issuer); - } - // - "The specified date must be equal to or later than the value of the - // thisUpdate component of the X509CRL and earlier than the value of the - // nextUpdate component." - crlSelector.setDateAndTime(validationDate); - Set crls = new HashSet(); try { - // Get the CRLs on each CertStore. - for (int i = 0; i < intermCertsAndCrls.length; i++) + for (int i = 0; i < certPath.size() - 1; i++) { - @SuppressWarnings("unchecked") - Collection storeCRLs = - (Collection) intermCertsAndCrls[i].getCRLs(crlSelector); - crls.addAll(Collections.checkedCollection(storeCRLs, X509CRL.class)); + X509Certificate cert = certPath.get(i); + + /* + * because the Sun X509CRLSelector is broken (won't find CRLs published + * in "future") we need to use our own or we won't be able to create + * C form from T form + */ + CRLSelector crlSelector = new CustomCRLSelector(cert, validationDate); + + // Get the CRLs on each CertStore. + for (int j = 0; j < intermCertsAndCrls.length; j++) + { + @SuppressWarnings("unchecked") + Collection storeCRLs = + (Collection) intermCertsAndCrls[j].getCRLs(crlSelector); + crls.addAll(Collections.checkedCollection(storeCRLs, X509CRL.class)); + } } } catch (CertStoreException ex) { @@ -428,6 +427,47 @@ public void addCertificates(Collection otherCerts, Date now) intermCertsAndCrls = newIntermCertsAndCrls; } + + private class CustomCRLSelector implements CRLSelector + { + private X509Certificate subjectCert; + private Date now; + + public CustomCRLSelector(X509Certificate subjectCertificate, Date checkingDate) + { + subjectCert = subjectCertificate; + now = checkingDate; + } + + public Object clone() + { + return new CustomCRLSelector(subjectCert, now); + } + + @Override + public boolean match(CRL crl) + { + if (!(crl instanceof X509CRL)) + return false; + X509CRL x509crl = (X509CRL) crl; + + // check if issuer of CRL is the same as the issuer of the certificate + X500Principal principal = x509crl.getIssuerX500Principal(); + if (!subjectCert.getIssuerX500Principal().equals(principal)) + return false; + + // CRL has to be valid for current time (but it can come from "future") + if (x509crl.getNextUpdate().getTime() < now.getTime()) + return false; + + // CRL must be published before certificate looses its validity + if (x509crl.getThisUpdate().getTime() >= subjectCert.getNotAfter().getTime()) + return false; + + return true; + } + } + /** * Add usage or implementation specific handlers to CertPathBuilderParameters * @param pkixbp From 53d07d9e11ec0c86fb276cd4341375215d73f802 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Fri, 14 Dec 2012 19:10:50 +0100 Subject: [PATCH 20/84] make PKIX certificate validator more tolerant of input If we're validating advanced forms of XAdES (C and above), we can sometimes get CRLs that look as if they came from future Signed-off-by: Tiago Rossi --- .../providers/impl/PKIXCertificateValidationProviderBase.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java index e8ca839e..1c23b733 100644 --- a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java +++ b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java @@ -265,10 +265,6 @@ public void addCRLs(Collection crls, Date now) for(X509CRL crl : crls) { - // check if it's not CRL from "future" - if (crl.getThisUpdate().getTime() > now.getTime()) - continue; - // TODO check algorithms used in CRL X509CertSelector certSel = new X509CertSelector(); From 5ea45dd23ffcb5eb32e0f962b1bbc716066b053c Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Fri, 14 Dec 2012 19:12:56 +0100 Subject: [PATCH 21/84] PKIX cert validator should be tolerant of input If we're validating advanced forms of XAdES, we need to provide validator with certificates and CRLs we found in Properties, they can be empty so we should be able handle this case gracefully Signed-off-by: Tiago Rossi --- .../providers/impl/PKIXCertificateValidationProviderBase.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java index 1c23b733..767608a6 100644 --- a/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java +++ b/src/main/java/xades4j/providers/impl/PKIXCertificateValidationProviderBase.java @@ -261,6 +261,8 @@ private Collection getCRLsForCertPath( public void addCRLs(Collection crls, Date now) { + if (crls == null) + return; Collection validCRLs = new ArrayList(); for(X509CRL crl : crls) @@ -343,6 +345,8 @@ public void addCRLs(Collection crls, Date now) public void addCertificates(Collection otherCerts, Date now) { + if (otherCerts == null) + return; Collection validCerts = new ArrayList(); /* From 8aacc5c69d83c178210d813fe066aa6c6c17682f Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sat, 15 Dec 2012 19:22:52 +0100 Subject: [PATCH 22/84] make verifiers of EncapsulatedPKIData collect the PKI data when dealing with XAdES-X-L form, we may have full revocation data at hand, then the verification needs only trust anchors (CA certificates) but we must allow for collection of those certificates and CRLs during validation of the EncapsulatedPKIData properties: CertificateValues, RevocationValues, AttrAuthoritiesCertValues and AttributeRevocationValues Signed-off-by: Tiago Rossi --- .../AttrAuthoritiesCertValuesVerifier.java | 7 ++ .../AttributeRevocationValuesVerifier.java | 9 +++ .../CertificateValuesVerifier.java | 12 ++++ .../EncapsulatedPKIDataVerifierBase.java | 5 ++ ...psulatedPKIRevocationDataVerifierBase.java | 6 ++ ...QualifyingPropertyVerificationContext.java | 71 +++++++++++++++++++ .../RevocationValuesVerifier.java | 10 +++ 7 files changed, 120 insertions(+) diff --git a/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java b/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java index 1ef3ec88..1f3a4ec9 100644 --- a/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java +++ b/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java @@ -24,6 +24,7 @@ import xades4j.properties.AttrAuthoritiesCertValuesProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.providers.TSACertificateValidationProvider; /** * @@ -44,4 +45,10 @@ public QualifyingProperty createProperty(Collection certs) return new AttrAuthoritiesCertValuesProperty(certs); } + public void addCertificatesToValidationProvider( + Collection certificates, + QualifyingPropertyVerificationContext ctx) + { + ctx.addAttributeCertificates(certificates); + } } diff --git a/src/main/java/xades4j/verification/AttributeRevocationValuesVerifier.java b/src/main/java/xades4j/verification/AttributeRevocationValuesVerifier.java index 7d29b0b1..60c3c144 100644 --- a/src/main/java/xades4j/verification/AttributeRevocationValuesVerifier.java +++ b/src/main/java/xades4j/verification/AttributeRevocationValuesVerifier.java @@ -24,6 +24,7 @@ import xades4j.properties.AttributeRevocationValuesProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.AttributeRevocationValuesData; +import xades4j.providers.TSACertificateValidationProvider; public class AttributeRevocationValuesVerifier extends EncapsulatedPKIRevocationDataVerifierBase @@ -39,4 +40,12 @@ public QualifyingProperty createProperty(Collection crls) { return new AttributeRevocationValuesProperty(crls); } + + @Override + public void addCRLsToValidationProvider( + Collection crls, + QualifyingPropertyVerificationContext ctx) + { + ctx.addAttributeCRLs(crls); + } } diff --git a/src/main/java/xades4j/verification/CertificateValuesVerifier.java b/src/main/java/xades4j/verification/CertificateValuesVerifier.java index c7cdbb2a..67d1ec1c 100644 --- a/src/main/java/xades4j/verification/CertificateValuesVerifier.java +++ b/src/main/java/xades4j/verification/CertificateValuesVerifier.java @@ -19,11 +19,15 @@ import java.security.cert.X509Certificate; import java.util.Collection; +import org.w3c.dom.Element; + import com.google.inject.Inject; import xades4j.properties.CertificateValuesProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.CertificateValuesData; +import xades4j.providers.CertificateValidationProvider; +import xades4j.providers.TSACertificateValidationProvider; /** * @@ -43,4 +47,12 @@ public QualifyingProperty createProperty(Collection certs) { return new CertificateValuesProperty(certs); } + + @Override + public void addCertificatesToValidationProvider( + Collection certificates, + QualifyingPropertyVerificationContext ctx) + { + ctx.addSignatureCertificates(certificates); + } } diff --git a/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java b/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java index 6e079b1a..4eaaf151 100644 --- a/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java +++ b/src/main/java/xades4j/verification/EncapsulatedPKIDataVerifierBase.java @@ -76,8 +76,13 @@ public QualifyingProperty verify(BaseEncapsulatedPKIData propData, } } + addCertificatesToValidationProvider(certificates, ctx); + return createProperty(certificates); } public abstract QualifyingProperty createProperty(Collection certs); + + public abstract void addCertificatesToValidationProvider(Collection certificates, + QualifyingPropertyVerificationContext ctx); } diff --git a/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java b/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java index 12f6a6c0..b03470d5 100644 --- a/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java +++ b/src/main/java/xades4j/verification/EncapsulatedPKIRevocationDataVerifierBase.java @@ -77,8 +77,14 @@ public QualifyingProperty verify(BaseEncapsulatedPKIData propData, } } + addCRLsToValidationProvider(crls, ctx); + return createProperty(crls); } public abstract QualifyingProperty createProperty(Collection crls); + + public abstract void addCRLsToValidationProvider( + Collection crls, + QualifyingPropertyVerificationContext ctx); } diff --git a/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java b/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java index 06d94903..4c7cef0e 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java +++ b/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java @@ -23,8 +23,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; + import javax.security.auth.x500.X500Principal; import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial; import org.apache.xml.security.signature.ObjectContainer; @@ -50,6 +53,10 @@ public class QualifyingPropertyVerificationContext private final CertificationChainData certChainData; private final SignedObjectsData signedObjectsData; private Collection attributeValidationData; + private final Set untrustedAttributeCertificates; + private final Set untrustedAttributeCRLs; + private final Set untrustedSignatureCertificates; + private final Set untrustedSignatureCRLs; QualifyingPropertyVerificationContext( XMLSignature signature, @@ -60,6 +67,10 @@ public class QualifyingPropertyVerificationContext this.certChainData = certChainData; this.signedObjectsData = signedObjectsData; attributeValidationData = new ArrayList(); + untrustedAttributeCertificates = new HashSet(); + untrustedAttributeCRLs = new HashSet(); + untrustedSignatureCertificates = new HashSet(); + untrustedSignatureCRLs = new HashSet(); } public Collection getAttributeValidationData() @@ -223,4 +234,64 @@ private TObj getReferencedElement( } } } + /** + * Remember the untrusted certificates found in properties. + * The same certificate can be provided multiple times and it will be saved only once. + * @param certificates found properties + */ + public void addAttributeCertificates(Collection certificates) + { + untrustedAttributeCertificates.addAll(certificates); + } + + /** + * Remember the untrusted attribute certificates found in properties. + * The same CRL can be provided multiple times and it will be saved only once. + * @param crls found crls + */ + public void addAttributeCRLs(Collection crls) + { + untrustedAttributeCRLs.addAll(crls); + } + + public Collection getAttributeCRLs() + { + return untrustedAttributeCRLs; + } + + public Collection getAttributeCertificates() + { + return untrustedAttributeCertificates; + } + + /** + * Remember the untrusted signature certificates found in properties. + * The same certificates can be provided multiple times and it will be saved only + * once. + * @param certificates certificates to save + */ + public void addSignatureCertificates(Collection certificates) + { + untrustedSignatureCertificates.addAll(certificates); + } + + /** + * Remember the untrusted signature revocation data (CRLs) found in properties. + * The same CRL can be provided multiple times and it will be save only one. + * @param crls CRLs to save + */ + public void addSignatureCRLs(Collection crls) + { + untrustedSignatureCRLs.addAll(crls); + } + + public Collection getSignatureCRLs() + { + return untrustedSignatureCRLs; + } + + public Collection getSignatureCertificates() + { + return untrustedSignatureCertificates; + } } diff --git a/src/main/java/xades4j/verification/RevocationValuesVerifier.java b/src/main/java/xades4j/verification/RevocationValuesVerifier.java index e3f61203..7626ae26 100644 --- a/src/main/java/xades4j/verification/RevocationValuesVerifier.java +++ b/src/main/java/xades4j/verification/RevocationValuesVerifier.java @@ -43,4 +43,14 @@ public QualifyingProperty createProperty(Collection crls) { return new RevocationValuesProperty(crls); } + + @Override + public void addCRLsToValidationProvider( + Collection crls, + QualifyingPropertyVerificationContext ctx) + { + ctx.addSignatureCRLs(crls); + } + + // TODO verify if the values in this property are matching the CompleteRevocationRefs } From bff7f817312dd4d46d2302178fb648ebeef35958 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Fri, 14 Dec 2012 19:32:21 +0100 Subject: [PATCH 23/84] fix XadesVerifierErrosTest tests change of verificato to soft-fail made the exception thrown different Signed-off-by: Tiago Rossi --- .../java/xades4j/verification/XadesVerifierErrorsTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java b/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java index e3a145d5..86c8382c 100644 --- a/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java @@ -96,14 +96,14 @@ public void testErrVerifyChangedSigValue() throws Exception verifyBadSignature("document.signed.bes.invalidsigvalue.xml", mySigsVerificationProfile); } - @Test(expected = CompleteCertRefsCertNotFoundException.class) + @Test(expected = InvalidXAdESFormException.class) public void testErrVerifyCMissingCertRef() throws Exception { System.out.println("errVerifyCMissingCertRef"); verifyBadSignature("document.signed.c.missingcertref.xml", nistVerificationProfile); } - @Test(expected = TimeStampDigestMismatchException.class) + @Test(expected = AssertionError.class) public void testErrVerifyUnmatchSigTSDigest() throws Exception { // DefaultTimeStampTokenProvider tsProv = new DefaultTimeStampTokenProvider(new DefaultMessageDigestProvider()); @@ -115,7 +115,8 @@ public void testErrVerifyUnmatchSigTSDigest() throws Exception // outputDocument(doc, "bad/document.signed.t.bes.badtsdigest.xml"); System.out.println("errVerifyUnmatchSigTSDigest"); - verifyBadSignature("document.signed.t.bes.badtsdigest.xml", mySigsVerificationProfile); + XAdESForm form = verifySignature("bad/" + "document.signed.t.bes.badtsdigest.xml", mySigsVerificationProfile); + assertEquals(XAdESForm.T, form); } private static void verifyBadSignature(String sigFileName, XadesVerificationProfile p) throws Exception From ffc46e47b66e0782b7c485fd79a1313ecf90010f Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sat, 15 Dec 2012 19:47:55 +0100 Subject: [PATCH 24/84] extend XadesHybridVerifier to XAdES-X-L support Signed-off-by: Tiago Rossi --- .../SignaturePropertiesCollectorImpl.java | 5 +- .../DefaultTimeStampVerificationProvider.java | 30 ++- .../CompleteCertRefsVerifier.java | 5 +- .../CompleteRevocRefsVerifier.java | 5 +- ...ybridQualifyingPropertiesVerifierImpl.java | 231 ++++++++++++++++-- .../QualifyingPropertiesVerifier.java | 19 +- .../QualifyingPropertiesVerifierImpl.java | 17 +- ...QualifyingPropertyVerificationContext.java | 80 +++++- .../SigningCertificateVerifier.java | 4 +- .../verification/XadesHybridVerifierImpl.java | 182 +++++++++----- .../verification/XadesVerifierImpl.java | 12 +- 11 files changed, 487 insertions(+), 103 deletions(-) diff --git a/src/main/java/xades4j/production/SignaturePropertiesCollectorImpl.java b/src/main/java/xades4j/production/SignaturePropertiesCollectorImpl.java index bb03c5b6..31124631 100644 --- a/src/main/java/xades4j/production/SignaturePropertiesCollectorImpl.java +++ b/src/main/java/xades4j/production/SignaturePropertiesCollectorImpl.java @@ -26,6 +26,7 @@ import xades4j.properties.SigningTimeProperty; import xades4j.properties.UnsignedSignatureProperty; import xades4j.providers.SignaturePropertiesCollector; +import xades4j.utils.PropertiesList; import xades4j.utils.PropertiesSet; /** @@ -34,13 +35,13 @@ class SignaturePropertiesCollectorImpl implements SignaturePropertiesCollector { private final PropertiesSet signedSigProps; - private final PropertiesSet unsignedSigProps; + private final PropertiesList unsignedSigProps; public SignaturePropertiesCollectorImpl() { this.signedSigProps = new PropertiesSet(2); - this.unsignedSigProps = new PropertiesSet(0); + this.unsignedSigProps = new PropertiesList(0); } /***** Signed signature properties *****/ diff --git a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java index fe076f06..4fb0f273 100644 --- a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java +++ b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java @@ -43,7 +43,6 @@ import org.bouncycastle.tsp.TimeStampToken; import xades4j.UnsupportedAlgorithmException; import xades4j.XAdES4jException; -import xades4j.providers.CertificateValidationProvider; import xades4j.providers.MessageDigestEngineProvider; import xades4j.providers.TSACertificateValidationProvider; import xades4j.providers.TimeStampTokenDigestException; @@ -83,7 +82,7 @@ private static String uriForDigest(ASN1ObjectIdentifier digestalgOid) { return digestOidToUriMappings.get(digestalgOid); } - private final TSACertificateValidationProvider certificateValidationProvider; + private final TSACertificateValidationProvider tsaCertificateValidationProvider; private final MessageDigestEngineProvider messageDigestProvider; private final JcaSimpleSignerInfoVerifierBuilder signerInfoVerifierBuilder; private final JcaX509CertificateConverter x509CertificateConverter; @@ -94,7 +93,7 @@ public DefaultTimeStampVerificationProvider( TSACertificateValidationProvider certificateValidationProvider, MessageDigestEngineProvider messageDigestProvider) { - this.certificateValidationProvider = certificateValidationProvider; + this.tsaCertificateValidationProvider = certificateValidationProvider; this.messageDigestProvider = messageDigestProvider; Provider bcProv = new BouncyCastleProvider(); @@ -124,27 +123,31 @@ public Date verifyToken(byte[] timeStampToken, byte[] tsDigestInput, } X509Certificate tsaCert = null; + ValidationData vData = null; try { /* Validate the TSA certificate */ // TODO should extract all certificates from the token - Iterator certsIt = tsToken.getCertificates().getMatches(tsToken.getSID()).iterator(); + Iterator certsIt = tsToken.getCertificates().getMatches(tsToken.getSID()).iterator(); if (certsIt.hasNext()) { tsaCert = this.x509CertificateConverter.getCertificate((X509CertificateHolder) certsIt.next()); } - - ValidationData vData = this.certificateValidationProvider.validate( + if (ctx != null) + { + tsaCertificateValidationProvider.addCertificates( + ctx.getAttributeCertificates(), ctx.getCurrentTime()); + tsaCertificateValidationProvider.addCRLs( + ctx.getAttributeCRLs(), ctx.getCurrentTime()); + } + + vData = this.tsaCertificateValidationProvider.validate( x509CertSelectorConverter.getCertSelector(tsToken.getSID()), - tsToken.getTimeStampInfo().getGenTime(), + (ctx == null) ? null : ctx.getCurrentTime(), // unit tests provision null == tsaCert ? null : Collections.singletonList(tsaCert)); tsaCert = vData.getCerts().get(0); - - // XXX should we really add validation data /before/ token validation? - if (ctx != null) - ctx.addAttributeValidationData(vData); } catch (CertificateException ex) { @@ -185,6 +188,11 @@ public Date verifyToken(byte[] timeStampToken, byte[] tsDigestInput, throw new TimeStampTokenVerificationException("The token's digest algorithm is not supported", ex); } + // token verified successfully, remember the validation data used for its + // verification + if (ctx != null) + ctx.addAttributeValidationData(vData); + return tsTokenInfo.getGenTime(); } } diff --git a/src/main/java/xades4j/verification/CompleteCertRefsVerifier.java b/src/main/java/xades4j/verification/CompleteCertRefsVerifier.java index 3ee18742..9e4556a6 100644 --- a/src/main/java/xades4j/verification/CompleteCertRefsVerifier.java +++ b/src/main/java/xades4j/verification/CompleteCertRefsVerifier.java @@ -17,6 +17,7 @@ package xades4j.verification; import com.google.inject.Inject; + import java.security.cert.X509Certificate; import java.util.Collection; import java.util.Collections; @@ -28,6 +29,7 @@ import xades4j.properties.QualifyingProperty; import xades4j.properties.data.CertRef; import xades4j.properties.data.CompleteCertificateRefsData; +import xades4j.providers.CertificateValidationProvider; import xades4j.providers.MessageDigestEngineProvider; /** @@ -40,7 +42,8 @@ class CompleteCertRefsVerifier implements QualifyingPropertyVerifier> sigAndRefsPropertySignedProperties; + private final Set> signedProperties; @Inject public HybridQualifyingPropertiesVerifierImpl( @@ -44,39 +66,172 @@ public HybridQualifyingPropertiesVerifierImpl( { propertyVerifiersMapper = propVerMapp; dataObjectsStructureVerifier = dataObjStructVerif; + Set> tmp = new HashSet>(); + // TODO tmp.add(AttributeRevocationRefsData.class); + // TODO tmp.add(AttributeCertificateRefsData.class); + tmp.add(CompleteRevocationRefsData.class); + tmp.add(CompleteCertificateRefsData.class); + tmp.add(SignatureTimeStampData.class); + sigAndRefsPropertySignedProperties = tmp; + + tmp = new HashSet>(); + tmp.add(IndividualDataObjsTimeStampData.class); + tmp.add(AllDataObjsTimeStampData.class); + tmp.add(CommitmentTypeData.class); + tmp.add(DataObjectFormatData.class); + tmp.add(SignerRoleData.class); + tmp.add(SignatureProdPlaceData.class); + tmp.add(SignaturePolicyData.class); + tmp.add(SigningCertificateData.class); + tmp.add(SigningTimeData.class); + signedProperties = tmp; } + /* + * new invocation method (one that knows about XML structure of properties) + */ @Override - public Collection verifyProperties( + public List verifyProperties( QualifyingPropertiesDataCollector dataCollector, QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, QualifyingPropertyVerifierNotAvailableException { - /* - * new invocation method (one that knows about XML structure of properties - */ - // verify internal data structure of properties (presence of mandatory elements // and sanity of all elements) List unmarshalledProperties = dataCollector.getPropertiesData(); dataObjectsStructureVerifier.verifiyPropertiesDataStructure(unmarshalledProperties); - Collection props = new ArrayList(unmarshalledProperties.size()); + List props = new LinkedList(); + + /* + * go over all properties and verify them + * because the most recent additions to the signature are (or at least SHOULD be) + * last, we go in reverse order + */ + ListIterator property = + unmarshalledProperties.listIterator(unmarshalledProperties.size()); + + PropertyDataObject propData; + do + { + propData = property.previous(); + /* + * Because ArchiveTimeStamp signs everything before its location, we update + * the currentTime in ctx just after its successful verification. + * This is not so easy with SignatureTimeStamp or SigAndRefsTimeStamp, there + * we can update the currentTime only after we went over all those + * properties, that is, we found the first property that should have been + * signed by SigAndRefsTimeStamp. + * + * TODO The situation is even more complex in the unsupported case of + * RefsOnlyTimeStamp. + * + * With SignatureTimeStamp similar situation occurs when there are only + * SignedProperties left or all properties have been handled + */ + try { + // when we encounter property that needs to be signed by + // sigAndRefsTimeStamp it means we should have parsed all + // SigAndRefsTimeStamps and can change time to the earliest one from + // those properties + if (sigAndRefsPropertySignedProperties.contains(propData.getClass())) + setDateFromSigAndRefsProperty(ctx, props); + // similar situation as with sigAndRefsTimeStamp but for SignatureTimeStamp + if (signedProperties.contains(propData.getClass())) + setDateFromSignatureTimeStamp(ctx, props); + + /* + * To verify those three properties we need result of Signature + * verification, so we add place holders for them and will verify them + * after Signature verification + */ + if (propData instanceof CompleteCertificateRefsData || + propData instanceof CompleteRevocationRefsData || + propData instanceof SigningCertificateData) + { + props.add(0, new PropertyInfo(propData, null)); + continue; + } + + QualifyingPropertyVerifier propVerifier = + this.propertyVerifiersMapper.getVerifier(propData); + + Element elem = (Element) dataCollector.getPropertyNode(propData); + + QualifyingProperty p = propVerifier.verify(propData, elem, ctx); + if (p == null) + throw new PropertyVerifierErrorException(propData + .getClass().getName()); + + // we go over properties in reverse order so we have to insert + // them at the beginning of the returned list to preserve order + props.add(0, new PropertyInfo(propData, p)); + + } catch (XAdES4jException e) // TODO make it less generic + { + // critical error + if (e instanceof SigningTimeVerificationException) + throw (InvalidPropertyException)e; + + // failure in verification of property will only cause its ommitance + // in returned property list + System.out.println("Error when verifying " + propData.getClass() + + ", stack trace follows: "); + e.printStackTrace(); + continue; + } + + } while (property.hasPrevious()); + + // SignedProperties are not mandatory so we have to try changing the time after + // parsing all properties + setDateFromSignatureTimeStamp(ctx, props); + + return Collections.unmodifiableList(props); + } + + private void setDateFromSignatureTimeStamp( + QualifyingPropertyVerificationContext ctx, + List props) + { + Date oldest = null; + for (PropertyInfo propInfo : props) + { + QualifyingProperty p = propInfo.getProperty(); + if (p instanceof SignatureTimeStampProperty) + { + SignatureTimeStampProperty sigTimeStamp = (SignatureTimeStampProperty) p; + if (oldest == null) + oldest = sigTimeStamp.getTime(); + else if (oldest.getTime() > sigTimeStamp.getTime().getTime()) + oldest = sigTimeStamp.getTime(); + } + } + if (oldest != null && oldest.getTime() != ctx.getCurrentTime().getTime()) + ctx.setCurrentTime(oldest); + } - for (PropertyDataObject propData : unmarshalledProperties) + private void setDateFromSigAndRefsProperty( + QualifyingPropertyVerificationContext ctx, + List props) + { + Date oldest = null; + for (PropertyInfo propInfo : props) { - QualifyingPropertyVerifier propVerifier = - this.propertyVerifiersMapper.getVerifier(propData); - Element elem = (Element) dataCollector.getPropertyNode(propData); - QualifyingProperty p = propVerifier.verify(propData, elem, ctx); - if (p == null) - throw new PropertyVerifierErrorException(propData.getClass().getName()); - - props.add(new PropertyInfo(propData, p)); + QualifyingProperty p = propInfo.getProperty(); + if (p instanceof SigAndRefsTimeStampProperty) + { + SigAndRefsTimeStampProperty sigAndRefs = (SigAndRefsTimeStampProperty) p; + if (oldest == null) + oldest = sigAndRefs.getTime(); + else if (oldest.getTime() > sigAndRefs.getTime().getTime()) + oldest = sigAndRefs.getTime(); + } } - return Collections.unmodifiableCollection(props); + if (oldest != null && oldest.getTime() != ctx.getCurrentTime().getTime()) + ctx.setCurrentTime(oldest); } @Deprecated @@ -95,4 +250,48 @@ public Collection verifyProperties( return qpv.verifyProperties(unmarshalledProperties, ctx); } + @Override + public List verifyProperties( + HybridQualifPropsDataCollectorImpl propsDataCollector, + QualifyingPropertyVerificationContext ctx, + List props) + { + // now we have full revocation information about Signature, go and verify + // *Refs and SignatureCertificate properties + + List newProps = new ArrayList(props.size()); + for (PropertyInfo p : props) + { + if (p.getProperty() == null) + { + PropertyDataObject propData = p.getPropertyData(); + try { + + QualifyingPropertyVerifier propVerifier = + this.propertyVerifiersMapper.getVerifier(propData); + + Element elem = (Element) propsDataCollector.getPropertyNode(propData); + + QualifyingProperty qp = propVerifier.verify(propData, elem, ctx); + if (qp == null) + throw new PropertyVerifierErrorException(propData + .getClass().getName()); + newProps.add(new PropertyInfo(propData, qp)); + + } catch (XAdES4jException e) + { + System.out.println("Error when verifying " + + p.getPropertyData().getClass() + ", stack trace follows: "); + e.printStackTrace(); + continue; + } + + } else { + newProps.add(p); + } + } + + return newProps; + } + } diff --git a/src/main/java/xades4j/verification/QualifyingPropertiesVerifier.java b/src/main/java/xades4j/verification/QualifyingPropertiesVerifier.java index 4d846a30..524ba8ac 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertiesVerifier.java +++ b/src/main/java/xades4j/verification/QualifyingPropertiesVerifier.java @@ -19,8 +19,11 @@ import java.util.Collection; import java.util.List; +import xades4j.properties.data.CompleteCertificateRefsData; +import xades4j.properties.data.CompleteRevocationRefsData; import xades4j.properties.data.PropertyDataObject; import xades4j.properties.data.PropertyDataStructureException; +import xades4j.properties.data.SigningCertificateData; import xades4j.xml.unmarshalling.QualifyingPropertiesDataCollector; /** @@ -32,7 +35,7 @@ interface QualifyingPropertiesVerifier /** * Verifies the data objects' structure and the XAdES rules. */ - Collection verifyProperties( + List verifyProperties( QualifyingPropertiesDataCollector unmarshalledProperties, QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, QualifyingPropertyVerifierNotAvailableException; @@ -46,4 +49,18 @@ Collection verifyProperties( Collection verifyProperties( List unmarshalledProperties, QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, QualifyingPropertyVerifierNotAvailableException; + + /** + * Verifies properties that can be verified only after Signature has been verified, + * namely {@link CompleteCertificateRefsData}, {@link CompleteRevocationRefsData} and + * {@link SigningCertificateData}. + * @param propsDataCollector + * @param qPropsCtx + * @param props + * @return + */ + List verifyProperties( + HybridQualifPropsDataCollectorImpl propsDataCollector, + QualifyingPropertyVerificationContext qPropsCtx, + List props); } diff --git a/src/main/java/xades4j/verification/QualifyingPropertiesVerifierImpl.java b/src/main/java/xades4j/verification/QualifyingPropertiesVerifierImpl.java index ea553d63..77b390f9 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertiesVerifierImpl.java +++ b/src/main/java/xades4j/verification/QualifyingPropertiesVerifierImpl.java @@ -47,7 +47,7 @@ class QualifyingPropertiesVerifierImpl implements QualifyingPropertiesVerifier } @Override - public Collection verifyProperties( + public List verifyProperties( QualifyingPropertiesDataCollector dataCollector, QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, QualifyingPropertyVerifierNotAvailableException { @@ -56,7 +56,7 @@ public Collection verifyProperties( } @Override - public Collection verifyProperties( + public List verifyProperties( List unmarshalledProperties, QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, @@ -64,7 +64,7 @@ public Collection verifyProperties( { dataObjectsStructureVerifier.verifiyPropertiesDataStructure(unmarshalledProperties); - Collection props = new ArrayList(unmarshalledProperties.size()); + List props = new ArrayList(unmarshalledProperties.size()); for (PropertyDataObject propData : unmarshalledProperties) { @@ -78,6 +78,15 @@ public Collection verifyProperties( props.add(new PropertyInfo(propData, p)); } - return Collections.unmodifiableCollection(props); + return Collections.unmodifiableList(props); + } + + @Override + public List verifyProperties( + HybridQualifPropsDataCollectorImpl propsDataCollector, + QualifyingPropertyVerificationContext qPropsCtx, + List props) + { + throw new UnsupportedOperationException("Use HybridQualifyingPropertiesVerifierImpl"); } } diff --git a/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java b/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java index 4c7cef0e..fdd912cc 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java +++ b/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -41,6 +42,7 @@ import org.w3c.dom.Node; import xades4j.providers.ValidationData; +import xades4j.verification.SignatureUtils.KeyInfoRes; /** * The context available during the verification of the qualifying properties. @@ -50,23 +52,52 @@ public class QualifyingPropertyVerificationContext { private final XMLSignature signature; - private final CertificationChainData certChainData; + private CertificationChainData certChainData; private final SignedObjectsData signedObjectsData; + private final KeyInfoRes keyInfoRes; + // validation data collected during verification of attributes (trusted) private Collection attributeValidationData; + // validation data collected during verification of signature (trusted) + private Collection signatureValidationData; private final Set untrustedAttributeCertificates; private final Set untrustedAttributeCRLs; private final Set untrustedSignatureCertificates; private final Set untrustedSignatureCRLs; + private Date currentTime; + QualifyingPropertyVerificationContext( XMLSignature signature, CertificationChainData certChainData, - SignedObjectsData signedObjectsData) + SignedObjectsData signedObjectsData, + Date currentTime) { this.signature = signature; this.certChainData = certChainData; this.signedObjectsData = signedObjectsData; attributeValidationData = new ArrayList(); + signatureValidationData = new ArrayList(); + this.keyInfoRes = null; + this.currentTime = currentTime; + untrustedAttributeCertificates = new HashSet(); + untrustedAttributeCRLs = new HashSet(); + untrustedSignatureCertificates = new HashSet(); + untrustedSignatureCRLs = new HashSet(); + } + + public QualifyingPropertyVerificationContext( + XMLSignature signature, + KeyInfoRes keyInfoRes, + SignedObjectsData signedObjectsData, + Date currentTime) + { + this.signature = signature; + this.signedObjectsData = signedObjectsData; + this.certChainData = null; + this.keyInfoRes = keyInfoRes; + attributeValidationData = new ArrayList(); + signatureValidationData = new ArrayList(); + this.currentTime = currentTime; untrustedAttributeCertificates = new HashSet(); untrustedAttributeCRLs = new HashSet(); untrustedSignatureCertificates = new HashSet(); @@ -83,6 +114,39 @@ public void addAttributeValidationData(ValidationData validationData) attributeValidationData.add(validationData); } + public Collection getSignatureValidationData() + { + return signatureValidationData; + } + + public void addSignatureValidationData(ValidationData validationData) + { + signatureValidationData.add(validationData); + } + + /** + * Changes the time at which subsequent verifications take place, used to ensure + * monotonicity of time in time stamps. + * + * @param currentTime new time at which subsequent verifications should happen + * @throws IllegalArgumentException when currentTime is later (in future) + * than time saved in this context + * ({@code currentTime.getTime() > this.currentTime.getTime()}) + */ + public void setCurrentTime(Date currentTime) + throws IllegalArgumentException + { + if (this.currentTime.getTime() < currentTime.getTime()) + throw new IllegalArgumentException("New time from TimeStamp is in the future"); + + this.currentTime = new Date(currentTime.getTime()); + } + + public Date getCurrentTime() + { + return currentTime; + } + public XMLSignature getSignature() { return signature; @@ -98,6 +162,11 @@ public SignedObjectsData getSignedObjectsData() return signedObjectsData; } + public KeyInfoRes getKeyInfoRes() + { + return keyInfoRes; + } + /** * */ @@ -234,6 +303,13 @@ private TObj getReferencedElement( } } } + + public void setCertificationChainData( + CertificationChainData certificationChainData) + { + this.certChainData = certificationChainData; + } + /** * Remember the untrusted certificates found in properties. * The same certificate can be provided multiple times and it will be saved only once. diff --git a/src/main/java/xades4j/verification/SigningCertificateVerifier.java b/src/main/java/xades4j/verification/SigningCertificateVerifier.java index f17b2ec4..41253131 100644 --- a/src/main/java/xades4j/verification/SigningCertificateVerifier.java +++ b/src/main/java/xades4j/verification/SigningCertificateVerifier.java @@ -27,6 +27,7 @@ import xades4j.properties.QualifyingProperty; import xades4j.properties.SigningCertificateProperty; import xades4j.properties.data.CertRef; +import xades4j.providers.CertificateValidationProvider; import xades4j.providers.MessageDigestEngineProvider; import xades4j.properties.data.SigningCertificateData; import xades4j.verification.QualifyingPropertyVerificationContext.CertificationChainData; @@ -41,7 +42,8 @@ class SigningCertificateVerifier implements QualifyingPropertyVerifier qualifPropsData = propsDataCollector.getPropertiesData(); - /* there be dragons (that is, wrong, bad, and so-on code)*/ - /* create certification path */ + /* + * extract data that uniquely identifies the key and/or certificate used for + * Signature signing from basic XML signature (XMLdsig) + */ KeyInfoRes keyInfoRes = SignatureUtils.processKeyInfo(signature.getKeyInfo()); - Date validationDate = getValidationDate(qualifPropsData, signature); + + /* + * Create the object which the property verifiers will use to get and save + * the status (context) of verification + */ + QualifyingPropertyVerificationContext qPropsCtx = new QualifyingPropertyVerificationContext( + signature, + keyInfoRes, + /**/ + new QualifyingPropertyVerificationContext.SignedObjectsData( + referencesRes.dataObjsReferences, + signature), + now); + + /* + * go over all qualified properties in reverse order, verify the properties, + * ignore invalid and return only successfully verified. + * Data structure verification is included. + * + * This is the first verification that ignores certificate and CRL references + * (as we know which certificates are needed and which CRLs are used only after + * verification of Signature) + */ + List props = + this.qualifyingPropertiesVerifier.verifyProperties(propsDataCollector, qPropsCtx); + + /* create certification path */ + Date validationDate = getValidationDate(props, now); + this.certificateValidator.addCertificates(qPropsCtx.getSignatureCertificates(), + validationDate); + this.certificateValidator.addCRLs(qPropsCtx.getSignatureCRLs(), validationDate); + ValidationData certValidationRes = this.certificateValidator.validate( keyInfoRes.certSelector, validationDate, @@ -159,25 +200,25 @@ public XAdESVerificationResult verify(Element signatureElem, throw new NullPointerException("Certificate validator returned null or empty data"); } X509Certificate validationCert = certValidationRes.getCerts().get(0); + /* Signature verification */ // Core XML-DSIG verification. doCoreVerification(signature, verificationOptions, validationCert); - // Create the properties verification context. - QualifyingPropertyVerificationContext qPropsCtx = new QualifyingPropertyVerificationContext( - signature, - new QualifyingPropertyVerificationContext.CertificationChainData( - certValidationRes.getCerts(), - certValidationRes.getCrls(), - keyInfoRes.issuerSerial), - /**/ - new QualifyingPropertyVerificationContext.SignedObjectsData( - referencesRes.dataObjsReferences, - signature)); - // Verify the properties. Data structure verification is included. - Collection props = this.qualifyingPropertiesVerifier.verifyProperties(propsDataCollector, qPropsCtx); + if (null == certValidationRes || certValidationRes.getCerts().isEmpty()) + { + throw new NullPointerException("Certificate validator returned null or empty data"); + } + + // perform verification of references to certificates and CRLs (revocation data) + qPropsCtx.setCertificationChainData( + new QualifyingPropertyVerificationContext.CertificationChainData( + certValidationRes.getCerts(), + certValidationRes.getCrls(), + keyInfoRes.issuerSerial)); + props = this.qualifyingPropertiesVerifier.verifyProperties(propsDataCollector, qPropsCtx, props); XAdESVerificationResult res = new XAdESVerificationResult( XAdESFormChecker.checkForm(props), @@ -201,6 +242,15 @@ public XAdESVerificationResult verify(Element signatureElem, SignatureSpecificVerificationOptions verificationOptions, XadesSignatureFormatExtender formatExtender, XAdESForm finalForm) throws XAdES4jException + { + Date now = new Date(); + return verify(signatureElem, verificationOptions, formatExtender, finalForm, now); + } + + protected XAdESVerificationResult verify(Element signatureElem, + SignatureSpecificVerificationOptions verificationOptions, + XadesSignatureFormatExtender formatExtender, XAdESForm finalForm, Date now) + throws XAdES4jException { if (null == finalForm || null == formatExtender) { @@ -214,7 +264,7 @@ public XAdESVerificationResult verify(Element signatureElem, throw new IllegalArgumentException("Signature format can only be extended to XAdES-T, C, X or X-L"); } - XAdESVerificationResult res = this.verify(signatureElem, verificationOptions); + XAdESVerificationResult res = this.verify(signatureElem, verificationOptions, now); XAdESForm actualForm = res.getSignatureForm(); if (actualForm.before(finalForm)) @@ -225,8 +275,8 @@ public XAdESVerificationResult verify(Element signatureElem, // * T -> C // * C -> X // * C -> X-L - // * X -> X-L (not supported with the library defaults: X cannot be verified) - // * X-L -> A (not supported with the library defaults: X-L cannot be verified) + // * X -> X-L + // * X-L -> A (not supported, A can't be created) FormExtensionPropsCollector finalFormPropsColector = formsExtensionTransitions[actualForm.ordinal()][finalForm.ordinal()]; @@ -243,15 +293,6 @@ public XAdESVerificationResult verify(Element signatureElem, return res; } - // used only for tests - protected XAdESVerificationResult verify(Element signatureNode, - SignatureSpecificVerificationOptions verificationOptions, - XadesSignatureFormatExtender formExt, XAdESForm c, Date date) - { - // TODO Auto-generated method stub - return null; - } - private static interface FormExtensionPropsCollector { @@ -289,8 +330,8 @@ public void addProps( Collection usp, XAdESVerificationResult res) { - PropertiesUtils.addXadesCProperties(usp, res.getValidationData()); PropertiesUtils.addXadesTProperties(usp); + PropertiesUtils.addXadesCProperties(usp, res.getValidationData()); } }; formsExtensionTransitions[XAdESForm.BES.ordinal()][XAdESForm.C.ordinal()] = cAndTPropsCol; @@ -333,12 +374,27 @@ public void addProps( Collection usp, XAdESVerificationResult res) { + PropertiesUtils.addXadesXProperties(usp); PropertiesUtils.addXadesXLProperties(usp, res.getValidationData(), res.getAttributeValidationData()); - PropertiesUtils.addXadesXProperties(usp); } }; formsExtensionTransitions[XAdESForm.C.ordinal()][XAdESForm.X_L.ordinal()] = xlAndXPropsCol; + + // X -> X-L + FormExtensionPropsCollector xlPropsCol = new FormExtensionPropsCollector() + { + @Override + public void addProps(Collection usp, + XAdESVerificationResult res) + { + PropertiesUtils.addXadesXLProperties( + usp, + res.getValidationData(), + res.getAttributeValidationData()); + } + }; + formsExtensionTransitions[XAdESForm.X.ordinal()][XAdESForm.X_L.ordinal()] = xlPropsCol; } public void setAcceptUnknownProperties(boolean acceptUnknownProperties) @@ -408,34 +464,40 @@ private static void doCoreVerification( } private Date getValidationDate( - Collection qualifPropsData, - XMLSignature signature) throws XAdES4jException + List props, Date now) + throws XAdES4jException { - List sigTsData = CollectionUtils.filterByType(qualifPropsData, SignatureTimeStampData.class); - - // If no signature time-stamp is present, use the current date. - if (sigTsData.isEmpty()) + Date earliestDate = now; + for (PropertyInfo p : props) { - return new Date(); + QualifyingProperty qp = p.getProperty(); + if (qp instanceof SignatureTimeStampProperty) + { + Date timeStampDate = ((SignatureTimeStampProperty)qp).getTime(); + if (earliestDate == null) + earliestDate = timeStampDate; + else if (earliestDate.getTime() > timeStampDate.getTime()) + earliestDate = timeStampDate; + } else if (qp instanceof SigAndRefsTimeStampProperty) + { + Date timeStampDate = ((SigAndRefsTimeStampProperty)qp).getTime(); + if (earliestDate == null) + earliestDate = timeStampDate; + else if (earliestDate.getTime() > timeStampDate.getTime()) + earliestDate = timeStampDate; + } else if (qp instanceof ArchiveTimeStampProperty) + { + Date timeStampDate = ((ArchiveTimeStampProperty)qp).getTime(); + if (earliestDate == null) + earliestDate = timeStampDate; + else if (earliestDate.getTime() > timeStampDate.getTime()) + earliestDate = timeStampDate; + } } + if (earliestDate == null) + earliestDate = new Date(); - // TODO support multiple SignatureTimeStamps (section 7.3 last paragraph of Standard v.1.4.2) - // This is a temporary solution. - // - Properties should probably be verified in two stages (before and after cert path creation). - // - Had to remove the custom structure verifier that checked if the SigningCertificate data was present. - QualifyingPropertyVerificationContext ctx = new QualifyingPropertyVerificationContext( - signature, - new QualifyingPropertyVerificationContext.CertificationChainData( - new ArrayList(0), - new ArrayList(0), - null), - /**/ - new QualifyingPropertyVerificationContext.SignedObjectsData( - new ArrayList(0), - signature)); - QualifyingProperty sigTs = this.qualifyingPropertiesVerifier.verifyProperties(sigTsData, ctx).iterator().next().getProperty(); - - return ((SignatureTimeStampProperty) sigTs).getTime(); + return earliestDate; } } diff --git a/src/main/java/xades4j/verification/XadesVerifierImpl.java b/src/main/java/xades4j/verification/XadesVerifierImpl.java index 17ebaf3f..31e231e4 100644 --- a/src/main/java/xades4j/verification/XadesVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesVerifierImpl.java @@ -208,7 +208,8 @@ public XAdESVerificationResult verify(Element signatureElem, SignatureSpecificVe /**/ new QualifyingPropertyVerificationContext.SignedObjectsData( referencesRes.dataObjsReferences, - signature)); + signature), + new Date()); // Verify the properties. Data structure verification is included. Collection props = this.qualifyingPropertiesVerifier.verifyProperties(propsDataCollector, qPropsCtx); @@ -258,7 +259,8 @@ private Date getValidationDate( /**/ new QualifyingPropertyVerificationContext.SignedObjectsData( new ArrayList(0), - signature)); + signature), + new Date()); QualifyingProperty sigTs = this.qualifyingPropertiesVerifier.verifyProperties(sigTsData, ctx).iterator().next().getProperty(); return ((SignatureTimeStampProperty) sigTs).getTime(); @@ -287,7 +289,8 @@ private Collection getCertificateValues( /**/ new QualifyingPropertyVerificationContext.SignedObjectsData( new ArrayList(0), - signature)); + signature), + new Date()); QualifyingProperty certVal = this.qualifyingPropertiesVerifier.verifyProperties(certValData, ctx).iterator().next().getProperty(); return ((CertificateValuesProperty) certVal).getCertificates(); @@ -316,7 +319,8 @@ private Collection getRevocationValues( /**/ new QualifyingPropertyVerificationContext.SignedObjectsData( new ArrayList(0), - signature)); + signature), + new Date()); QualifyingProperty revVal = this.qualifyingPropertiesVerifier.verifyProperties(revValData, ctx).iterator().next().getProperty(); return ((RevocationValuesProperty) revVal).getCrls(); From 32e34da9dfb36cc3bf8eb83cbe12aeb42facbaea Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Fri, 14 Dec 2012 19:41:59 +0100 Subject: [PATCH 25/84] documentation fixes Signed-off-by: Tiago Rossi --- src/main/java/xades4j/verification/SignatureUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/xades4j/verification/SignatureUtils.java b/src/main/java/xades4j/verification/SignatureUtils.java index 1a6822f8..617bb8ef 100644 --- a/src/main/java/xades4j/verification/SignatureUtils.java +++ b/src/main/java/xades4j/verification/SignatureUtils.java @@ -53,6 +53,9 @@ private SignatureUtils() } /**/ + /** + * Unique identifier of key used for Signature + */ static class KeyInfoRes { From 6c0ea57a30da33847c2db263c0922cb1c153b711 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 16 Dec 2012 20:14:59 +0100 Subject: [PATCH 26/84] add tests for basic A form Signed-off-by: Tiago Rossi --- .../verification/XadesVerifierImplTest.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/test/java/xades4j/verification/XadesVerifierImplTest.java b/src/test/java/xades4j/verification/XadesVerifierImplTest.java index 95a51e76..7e27a8f1 100644 --- a/src/test/java/xades4j/verification/XadesVerifierImplTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierImplTest.java @@ -26,6 +26,7 @@ import org.w3c.dom.NodeList; import xades4j.production.XadesFormatExtenderProfile; import xades4j.production.XadesSignatureFormatExtender; +import xades4j.properties.ArchiveTimeStampProperty; import xades4j.properties.AttrAuthoritiesCertValuesProperty; import xades4j.properties.AttributeRevocationValuesProperty; import xades4j.properties.CertificateValuesProperty; @@ -252,6 +253,35 @@ public void testVerifyXL() throws Exception assertEquals(XAdESForm.X_L, f); } + @Test + public void testVerifyXLEnrichA() throws Exception + { + System.out.println("testVerifyXLEnrichA"); + + Document doc = getDocument("out/document.verified.c.xl.xml"); + Element signatureNode = getSigElement(doc); + + XadesSignatureFormatExtender formExt = + new XadesFormatExtenderProfile().getFormatExtender(); + XAdESVerificationResult res = nistVerificationProfile.newVerifier().verify( + signatureNode, null, formExt, XAdESForm.A); + + assertEquals(XAdESForm.X_L, res.getSignatureForm()); + assertPropXAdES141ElementPresent(signatureNode, ArchiveTimeStampProperty.PROP_NAME); + + outputDocument(doc, "document.verified.c.xl.a.xml"); + } + + @Test + public void testVerifyA() throws Exception + { + System.out.println("testVerifyA"); + XAdESForm f = verifySignature( + "out/document.verified.c.xl.a.xml", + nistVerificationProfile); + assertEquals(XAdESForm.A, f); + } + private static void assertPropElementPresent( Element sigElem, String elemName) @@ -259,4 +289,13 @@ private static void assertPropElementPresent( NodeList props = sigElem.getElementsByTagNameNS(QualifyingProperty.XADES_XMLNS, elemName); assertFalse(props.getLength() == 0); } + + private static void assertPropXAdES141ElementPresent( + Element sigElem, + String elemName) + { + NodeList props = sigElem.getElementsByTagNameNS( + QualifyingProperty.XADESV141_XMLNS, elemName); + assertFalse(props.getLength() == 0); + } } From 3432c015136f445aa6e1e720c777acc24354b492 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 16 Dec 2012 22:00:04 +0100 Subject: [PATCH 27/84] add support for validating ArchiveTimeStamp property Signed-off-by: Tiago Rossi --- .../properties/ArchiveTimeStampProperty.java | 2 +- .../ArchiveTimeStampVerifier.java | 261 ++++++++++++++++++ .../DefaultVerificationBindingsModule.java | 2 + .../HybridQualifPropsDataCollectorImpl.java | 10 + ...ybridQualifyingPropertiesVerifierImpl.java | 1 + .../QualifPropsDataCollectorImpl.java | 7 + .../QualifyingPropertiesDataCollector.java | 3 + 7 files changed, 285 insertions(+), 1 deletion(-) create mode 100644 src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java diff --git a/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java b/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java index 6af6f7f3..b3803562 100644 --- a/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java +++ b/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java @@ -51,6 +51,6 @@ public void setTime(Date time) @Override public String getName() { - throw new UnsupportedOperationException("Not supported yet."); + return PROP_NAME; } } diff --git a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java new file mode 100644 index 00000000..16ef1ac1 --- /dev/null +++ b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java @@ -0,0 +1,261 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import org.apache.xml.security.exceptions.XMLSecurityException; +import org.apache.xml.security.keys.KeyInfo; +import org.apache.xml.security.signature.Reference; +import org.apache.xml.security.signature.SignedInfo; +import org.apache.xml.security.utils.Constants; +import org.w3c.dom.Element; + +import com.google.inject.Inject; + +import xades4j.properties.ArchiveTimeStampProperty; +import xades4j.properties.AttrAuthoritiesCertValuesProperty; +import xades4j.properties.AttributeRevocationValuesProperty; +import xades4j.properties.CertificateValuesProperty; +import xades4j.properties.CompleteCertificateRefsProperty; +import xades4j.properties.CompleteRevocationRefsProperty; +import xades4j.properties.CounterSignatureProperty; +import xades4j.properties.QualifyingProperty; +import xades4j.properties.RevocationValuesProperty; +import xades4j.properties.SigAndRefsTimeStampProperty; +import xades4j.properties.SignatureTimeStampProperty; +import xades4j.properties.data.ArchiveTimeStampData; +import xades4j.providers.TimeStampVerificationProvider; +import xades4j.utils.CannotAddDataToDigestInputException; +import xades4j.utils.DOMHelper; +import xades4j.utils.TimeStampDigestInput; +import xades4j.utils.TimeStampDigestInputFactory; + +public class ArchiveTimeStampVerifier extends + TimeStampVerifierBase +{ + + @Inject + public ArchiveTimeStampVerifier( + TimeStampVerificationProvider timeStampVerifier, + TimeStampDigestInputFactory timeStampDigestInputFactory) + { + super(timeStampVerifier, timeStampDigestInputFactory, + ArchiveTimeStampProperty.PROP_NAME); + } + + @Override + protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + ArchiveTimeStampData propData, Element location, + TimeStampDigestInput digestInput, + QualifyingPropertyVerificationContext ctx) + throws CannotAddDataToDigestInputException, + TimeStampVerificationException + { + // Archive time stamp is taken over: References, SignedInfor, SignatureValue, + // KeyInfo and all UnsignedSignatureProperties in order of appearance + + // References, processed accordingly to XML-DSIG. + SignedInfo signedInfo = ctx.getSignature().getSignedInfo(); + try + { + for (int i=0; i < signedInfo.getLength(); i++) + { + Reference ref = signedInfo.item(i); + digestInput.addReference(ref); + } + } catch (XMLSecurityException e) + { + throw new CannotAddDataToDigestInputException(e); + } + + // SignedInfo + Element e = ctx.getSignature().getSignedInfo().getElement(); + digestInput.addNode(e); + + // SignatureValue. + e = DOMHelper.getFirstDescendant( + ctx.getSignature().getElement(), + Constants.SignatureSpecNS, Constants._TAG_SIGNATUREVALUE); + digestInput.addNode(e); + + // KeyInfo, if present + KeyInfo ki = ctx.getSignature().getKeyInfo(); + if (ki != null) + digestInput.addNode(ki.getElement()); + + /* + * XAdES v1.4.2 standard, section G.2.2.16.2.4, implicit mechanism: " + * 1) Step 5) is performed as indicated. The verifier will take, + * among the unsigned properties that appear before the property that + * is being verified, those that appear in the following list, and in + * their order of appearance: SignatureTimeStamp, CounterSignature, + * CompleteCertificateRefs, CompleteRevocationRefs, + * AttributeCertificateRefs, AttributeRevocationRefs, + * CertificateValues, RevocationValues, SigAndRefsTimeStamp, + * RefsOnlyTimeStamp, xadesv141:ArchiveTimeStamp, + * xadesv141:TimeStampDataValidation and all the ds:Object elements + * different to the one containing the QualifyingProperties." + * + * section 8.2.1, item 4), requires the presence of CertificateValues and + * RevocationValues. If the signature contains other TimeStamps then + * AttrAuthoritiesCertValues and AttributeRevocationValues must be present, + * but only if Attribute Authorities don't share CRLs/OCSP or (sub)CAs with + * Signature. Because of that, we will only require presence of CertValues and + * RevocationValues. + */ + boolean certificateValuesPresent = false; + boolean revocationValuesPresent = false; + // TODO test with document having only XAdES-X-L (above ones) properties + + // requirements from SigAndRefsTimeStamp, only enforce singletonity, not presence + boolean completeCertRefsPresent = false; + boolean completeRevocRefsPresent = false; + + // all previous properties in order of appearance + for(Element elem = DOMHelper.getFirstChildElement(location.getParentNode()); + elem != location; + elem = DOMHelper.getNextSiblingElement(elem)) + { + if (isElementMatchingProperty(elem, + SignatureTimeStampProperty.class)) + { + // there are no specific requirements for SignatureTimeStamp + // so just add them + digestInput.addNode(elem); + // TODO check if there are no SignatureTimestamps *after* + // SigAndRefsTimeStamp + } else if (isElementMatchingProperty(elem, + CounterSignatureProperty.class)) + { + digestInput.addNode(elem); + } else if (isElementMatchingProperty(elem, + CompleteCertificateRefsProperty.class)) + { + // there must be exactly one CompleteCertificateRefs element + if (completeCertRefsPresent) + throw new CannotAddDataToDigestInputException( + new Exception( + "Duplicate CompleteCertificateRefs property" + + " in Signature")); + completeCertRefsPresent = true; + digestInput.addNode(elem); + // TODO check if there are no CompleteCertificateRefs + // *after* SigAndRefsTimeStamp + } else if (isElementMatchingProperty(elem, + CompleteRevocationRefsProperty.class)) + { + // there must be exactly one CompleteRevocationRefs element + if (completeRevocRefsPresent) + throw new CannotAddDataToDigestInputException( + new Exception( + "Duplicate CompleteRevocationRefs property" + + " in Singature")); + completeRevocRefsPresent = true; + digestInput.addNode(elem); + // TODO check if there are no CompleteRevocationRefs *after* + // SigAndRefsTimeStamp + } else if (elem.getLocalName().equalsIgnoreCase( + "AttributeCertificateRefs") + && elem.getNamespaceURI().equalsIgnoreCase( + QualifyingProperty.XADES_XMLNS)) + { + // TODO implement AttributeCertificateRefs support + throw new CannotAddDataToDigestInputException( + new Exception("Can't verify SigAndRefsTimeStamp: " + + "AttributeCertificateRefs is unsupported")); + } else if (elem.getLocalName().equalsIgnoreCase( + "AttributeRevocationRefs") + && elem.getNamespaceURI().equalsIgnoreCase( + QualifyingProperty.XADES_XMLNS)) + { + // TODO implement AttributeRevocationRefs support + throw new CannotAddDataToDigestInputException( + new Exception("Can't verify SigAndRefsTimeStamp: " + + "AttributeRevocationRefs is unsupported")); + } else if (isElementMatchingProperty(elem, + CertificateValuesProperty.class)) + { + if (certificateValuesPresent) + throw new CannotAddDataToDigestInputException(new Exception( + "Duplicate CertificateValues property in Signature")); + + certificateValuesPresent = true; + digestInput.addNode(elem); + } else if (isElementMatchingProperty(elem, + RevocationValuesProperty.class)) + { + if (revocationValuesPresent) + throw new CannotAddDataToDigestInputException(new Exception( + "Duplicate RevocationValues property in Signature")); + revocationValuesPresent = true; + digestInput.addNode(elem); + } else if (isElementMatchingProperty(elem, + SigAndRefsTimeStampProperty.class)) + { + digestInput.addNode(elem); + } else if (isElementMatchingProperty(elem, + AttrAuthoritiesCertValuesProperty.class)) + { + digestInput.addNode(elem); + } else if (isElementMatchingProperty(elem, + AttributeRevocationValuesProperty.class)) + { + digestInput.addNode(elem); + } else if (isElementMatchingProperty(elem, + ArchiveTimeStampProperty.class)) + { + digestInput.addNode(elem); + } // else: ignore other properties + // TODO add TimeStampDataValidation property + } + + if (certificateValuesPresent && revocationValuesPresent) + return new ArchiveTimeStampProperty(); + else + throw new CannotAddDataToDigestInputException(new Exception( + "Missing mandatory properties: CertificateValues" + + " or RevocationValues")); + } + + + private boolean isElementMatchingProperty(Element elem, + Class prop) + { + try + { + return elem.getLocalName().equalsIgnoreCase( + (String) prop.getField("PROP_NAME").get(null)) + && elem.getNamespaceURI().equalsIgnoreCase( + (String) prop.getField("XADES_XMLNS").get(null)); + } catch (IllegalArgumentException e) + { + e.printStackTrace(); + throw new InternalError("Wrong property class"); + } catch (SecurityException e) + { + e.printStackTrace(); + throw new InternalError("Wrong property class"); + } catch (IllegalAccessException e) + { + e.printStackTrace(); + throw new InternalError("Wrong property class"); + } catch (NoSuchFieldException e) + { + e.printStackTrace(); + throw new InternalError("Wrong property class"); + } + } +} diff --git a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java index 04d1aeab..42106957 100644 --- a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java +++ b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java @@ -28,6 +28,7 @@ import xades4j.properties.ObjectIdentifier; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.ArchiveTimeStampData; import xades4j.properties.data.AttrAuthoritiesCertValuesData; import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; @@ -125,6 +126,7 @@ public InputStream getSignaturePolicyDocumentStream( bindBuiltInVerifier(AttrAuthoritiesCertValuesData.class, AttrAuthoritiesCertValuesVerifier.class); bindBuiltInVerifier(RevocationValuesData.class, RevocationValuesVerifier.class); bindBuiltInVerifier(AttributeRevocationValuesData.class, AttributeRevocationValuesVerifier.class); + bindBuiltInVerifier(ArchiveTimeStampData.class, ArchiveTimeStampVerifier.class); MapBinder unkownElemsBinder = MapBinder.newMapBinder(binder(), QName.class, QualifyingPropertyVerifier.class); unkownElemsBinder diff --git a/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java index f67edb56..1fa0ba25 100644 --- a/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java @@ -23,6 +23,7 @@ import org.w3c.dom.Node; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.ArchiveTimeStampData; import xades4j.properties.data.AttrAuthoritiesCertValuesData; import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; @@ -210,6 +211,15 @@ public void setAttributeRevocationValues( unsignedSigProperties.put(attrRevocValData); } + @Override + public void addArchiveTimeStamp(ArchiveTimeStampData tsData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property!"); + + unsignedSigProperties.add(tsData); + } + List getUnsignedPropertiesData() { return unsignedSigProperties.getProperties(); diff --git a/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java b/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java index d2aa7ed7..d7317727 100644 --- a/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java +++ b/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java @@ -140,6 +140,7 @@ public List verifyProperties( // similar situation as with sigAndRefsTimeStamp but for SignatureTimeStamp if (signedProperties.contains(propData.getClass())) setDateFromSignatureTimeStamp(ctx, props); + // verificator of ArchiveTimeStamp changes time itself /* * To verify those three properties we need result of Signature diff --git a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java index 3fa23ace..efee810a 100644 --- a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java @@ -22,6 +22,7 @@ import org.w3c.dom.Node; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.ArchiveTimeStampData; import xades4j.properties.data.AttrAuthoritiesCertValuesData; import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; @@ -193,4 +194,10 @@ public Node getPropertyNode(PropertyDataObject pdo) " support getPropertyNode() method. Use HybridQualifPropsDataCollectorImpl."); } + @Override + public void addArchiveTimeStamp(ArchiveTimeStampData tsData) + { + propsData.add(tsData); + } + } diff --git a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java index caaf9c7c..c2d798a4 100644 --- a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java +++ b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java @@ -22,6 +22,7 @@ import org.w3c.dom.Node; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.ArchiveTimeStampData; import xades4j.properties.data.AttrAuthoritiesCertValuesData; import xades4j.properties.data.AttributeRevocationValuesData; import xades4j.properties.data.CertificateValuesData; @@ -98,6 +99,8 @@ public void setAttrAuthoritiesCertValues( public void setAttributeRevocationValues( AttributeRevocationValuesData attrRevocValData); + public void addArchiveTimeStamp(ArchiveTimeStampData tsData); + public void linkPropertyToElem(Element node); /** From 903c1d4055f4ca23ab8c75e3faef9aa3d56ce8d1 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 16 Dec 2012 19:13:19 +0100 Subject: [PATCH 28/84] Align implementation with version 1.4.2 of the standard Signed-off-by: Tiago Rossi --- .../java/xades4j/properties/ArchiveTimeStampProperty.java | 3 ++- src/main/java/xades4j/xml/bind/xades/ObjectFactory.java | 8 ++++---- .../bind/xades/XmlUnsignedSignaturePropertiesType.java | 2 +- .../xml/marshalling/ToXmlArchiveTimeStampConverter.java | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java b/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java index b3803562..645b6127 100644 --- a/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java +++ b/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java @@ -25,7 +25,8 @@ */ public final class ArchiveTimeStampProperty extends UnsignedSignatureProperty { - public static final String PROP_NAME = "xadesv141:ArchiveTimeStamp"; + // it's in "xades141" namespace though! + public static final String PROP_NAME = "ArchiveTimeStamp"; /**/ private Date time; diff --git a/src/main/java/xades4j/xml/bind/xades/ObjectFactory.java b/src/main/java/xades4j/xml/bind/xades/ObjectFactory.java index b19a976e..91ff4fc3 100644 --- a/src/main/java/xades4j/xml/bind/xades/ObjectFactory.java +++ b/src/main/java/xades4j/xml/bind/xades/ObjectFactory.java @@ -59,7 +59,7 @@ public class ObjectFactory { private final static QName _AllDataObjectsTimeStamp_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "AllDataObjectsTimeStamp"); private final static QName _SignerRole_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "SignerRole"); private final static QName _RevocationValues_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "RevocationValues"); - private final static QName _ArchiveTimeStampV2_QNAME = new QName("http://uri.etsi.org/01903/v1.4.1#", "ArchiveTimeStampV2"); + private final static QName _ArchiveTimeStampV1_4_1_QNAME = new QName("http://uri.etsi.org/01903/v1.4.1#", "ArchiveTimeStamp"); private final static QName _QualifyingPropertiesReference_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "QualifyingPropertiesReference"); private final static QName _CertificateValues_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "CertificateValues"); private final static QName _Any_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "Any"); @@ -728,9 +728,9 @@ public JAXBElement createRevocationValues(XmlRevocation * Create an instance of {@link JAXBElement }{@code <}{@link XmlXAdESTimeStampType }{@code >}} * */ - @XmlElementDecl(namespace = "http://uri.etsi.org/01903/v1.4.1#", name = "ArchiveTimeStampV2") - public JAXBElement createArchiveTimeStampV2(XmlXAdESTimeStampType value) { - return new JAXBElement(_ArchiveTimeStampV2_QNAME, XmlXAdESTimeStampType.class, null, value); + @XmlElementDecl(namespace = "http://uri.etsi.org/01903/v1.4.1#", name = "ArchiveTimeStamp") + public JAXBElement createArchiveTimeStampV1_4_1(XmlXAdESTimeStampType value) { + return new JAXBElement(_ArchiveTimeStampV1_4_1_QNAME, XmlXAdESTimeStampType.class, null, value); } /** diff --git a/src/main/java/xades4j/xml/bind/xades/XmlUnsignedSignaturePropertiesType.java b/src/main/java/xades4j/xml/bind/xades/XmlUnsignedSignaturePropertiesType.java index d24d9f5f..70d13d6f 100644 --- a/src/main/java/xades4j/xml/bind/xades/XmlUnsignedSignaturePropertiesType.java +++ b/src/main/java/xades4j/xml/bind/xades/XmlUnsignedSignaturePropertiesType.java @@ -41,7 +41,7 @@ * <element name="RevocationValues" type="{http://uri.etsi.org/01903/v1.3.2#}RevocationValuesType" minOccurs="0"/> * <element name="AttrAuthoritiesCertValues" type="{http://uri.etsi.org/01903/v1.3.2#}CertificateValuesType" minOccurs="0"/> * <element name="AttributeRevocationValues" type="{http://uri.etsi.org/01903/v1.3.2#}RevocationValuesType" minOccurs="0"/> - * <element name="ArchiveTimeStamp" type="{http://uri.etsi.org/01903/v1.3.2#}XAdESTimeStampType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="ArchiveTimeStamp" type="{http://uri.etsi.org/01903/v1.4.2#}XAdESTimeStampType" maxOccurs="unbounded" minOccurs="0"/> * <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/> * </sequence> * <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" /> diff --git a/src/main/java/xades4j/xml/marshalling/ToXmlArchiveTimeStampConverter.java b/src/main/java/xades4j/xml/marshalling/ToXmlArchiveTimeStampConverter.java index 1936819b..568fdefe 100644 --- a/src/main/java/xades4j/xml/marshalling/ToXmlArchiveTimeStampConverter.java +++ b/src/main/java/xades4j/xml/marshalling/ToXmlArchiveTimeStampConverter.java @@ -39,7 +39,7 @@ protected void insertIntoObjectTree( XmlUnsignedPropertiesType xmlProps, ArchiveTimeStampData propData) { - JAXBElement xmlArchTS = new ObjectFactory().createArchiveTimeStampV2(xmlTimeStamp); + JAXBElement xmlArchTS = new ObjectFactory().createArchiveTimeStampV1_4_1(xmlTimeStamp); xmlProps.getUnsignedSignatureProperties().getAny().add(xmlArchTS); } } From 73209ff55fe1bec3b9a27050203721e09d8423d0 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 16 Dec 2012 19:13:57 +0100 Subject: [PATCH 29/84] update form checker to XAdES-A support Signed-off-by: Tiago Rossi --- src/main/java/xades4j/verification/XAdESFormChecker.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/xades4j/verification/XAdESFormChecker.java b/src/main/java/xades4j/verification/XAdESFormChecker.java index e3dabcb7..2208d8e5 100644 --- a/src/main/java/xades4j/verification/XAdESFormChecker.java +++ b/src/main/java/xades4j/verification/XAdESFormChecker.java @@ -47,7 +47,7 @@ static XAdESForm checkForm(Collection props) throws InvalidXAdESFo availablePropsNames.add(propInfo.getProperty().getName()); } - XAdESFormDesc formDesc = XADES_X_L_DESC; + XAdESFormDesc formDesc = XADES_A_DESC; do { if (formDesc.check(availablePropsNames)) @@ -69,7 +69,8 @@ static XAdESForm checkForm(Collection props) throws InvalidXAdESFo XADES_T_DESC = new XAdES_T_Desc(), XADES_C_DESC = new XAdES_C_Desc(), XADES_X_DESC = new XAdES_X_Desc(), - XADES_X_L_DESC = new XAdES_X_L_Desc(); + XADES_X_L_DESC = new XAdES_X_L_Desc(), + XADES_A_DESC = new XAdES_A_Desc(); /**************************************************************************/ /**/ From b41dfe1123d2d3de0822234efe40b8ba05a2bd04 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 16 Dec 2012 19:40:17 +0100 Subject: [PATCH 30/84] add ArchiveTimeStamp unmarshaller Signed-off-by: Tiago Rossi --- .../FromXmlArchiveTimeStampConverter.java | 57 +++++++++++++++++++ ...ybridQualifyingPropertiesUnmarshaller.java | 13 +++++ .../unmarshalling/UnsignedSigPropsModule.java | 1 + 3 files changed, 71 insertions(+) create mode 100644 src/main/java/xades4j/xml/unmarshalling/FromXmlArchiveTimeStampConverter.java diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlArchiveTimeStampConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlArchiveTimeStampConverter.java new file mode 100644 index 00000000..1c7b0346 --- /dev/null +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlArchiveTimeStampConverter.java @@ -0,0 +1,57 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.unmarshalling; + +import xades4j.algorithms.Algorithm; +import xades4j.properties.ArchiveTimeStampProperty; +import xades4j.properties.data.ArchiveTimeStampData; +import xades4j.xml.bind.xades.XmlUnsignedSignaturePropertiesType; + +public class FromXmlArchiveTimeStampConverter extends + FromXmlBaseTimeStampConverter + implements UnsignedSigPropFromXmlConv +{ + + public FromXmlArchiveTimeStampConverter() + { + super(ArchiveTimeStampProperty.PROP_NAME); + } + + @Override + public void convertFromObjectTree( + XmlUnsignedSignaturePropertiesType xmlProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { + super.convertTimeStamps(xmlProps.getArchiveTimeStamp(), + propertyDataCollector); + } + + @Override + protected ArchiveTimeStampData createTSData(Algorithm c14n) + { + return new ArchiveTimeStampData(c14n); + } + + @Override + protected void setTSData(ArchiveTimeStampData tsData, + QualifyingPropertiesDataCollector propertyDataCollector) + { + propertyDataCollector.addArchiveTimeStamp(tsData); + } + +} diff --git a/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java b/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java index 2548bb48..b073efe3 100644 --- a/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java +++ b/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java @@ -347,6 +347,19 @@ private void unmarshalUnsignedSignatureProperties(Element unsignedSigProps, // TODO counter signature not supported continue; + } else if (isNodeTheProperty(node, ArchiveTimeStampProperty.class)) + { + JAXBElement xmlArchiveTimeStampElem = + unmarshallElement(node, XmlXAdESTimeStampType.class); + + List archivalTimeStamps = + new ArrayList(); + archivalTimeStamps.add(xmlArchiveTimeStampElem.getValue()); + + FromXmlArchiveTimeStampConverter archTSConv = + new FromXmlArchiveTimeStampConverter(); + + archTSConv.convertTimeStamps(archivalTimeStamps , propertyDataCollector); } else if (!acceptUnknown) // not recognized property throw new UnmarshalException("Unknown unsigned signature property: " diff --git a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java index 4bb5d9a7..97b3e9a4 100644 --- a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java +++ b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java @@ -41,6 +41,7 @@ class UnsignedSigPropsModule extends UnmarshallerModule Date: Sun, 16 Dec 2012 20:03:31 +0100 Subject: [PATCH 31/84] add ability to extend X-L form to basic A form Signed-off-by: Tiago Rossi --- .../verification/XadesHybridVerifierImpl.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java index 4964b3e5..2b2d79cb 100644 --- a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -259,9 +259,9 @@ protected XAdESVerificationResult verify(Element signatureElem, // The transitions matrix won't allow this, but this way I avoid the // unnecessary processing. - if (finalForm.before(XAdESForm.T) || finalForm.after(XAdESForm.X_L)) + if (finalForm.before(XAdESForm.T) || finalForm.after(XAdESForm.A)) { - throw new IllegalArgumentException("Signature format can only be extended to XAdES-T, C, X or X-L"); + throw new IllegalArgumentException("Signature format can only be extended to XAdES-T or above"); } XAdESVerificationResult res = this.verify(signatureElem, verificationOptions, now); @@ -276,7 +276,7 @@ protected XAdESVerificationResult verify(Element signatureElem, // * C -> X // * C -> X-L // * X -> X-L - // * X-L -> A (not supported, A can't be created) + // * X-L -> A FormExtensionPropsCollector finalFormPropsColector = formsExtensionTransitions[actualForm.ordinal()][finalForm.ordinal()]; @@ -395,6 +395,18 @@ public void addProps(Collection usp, } }; formsExtensionTransitions[XAdESForm.X.ordinal()][XAdESForm.X_L.ordinal()] = xlPropsCol; + + // X-L -> A + FormExtensionPropsCollector aPropsCol = new FormExtensionPropsCollector() + { + @Override + public void addProps(Collection usp, + XAdESVerificationResult res) + { + PropertiesUtils.addXadesAProperties(usp); + } + }; + formsExtensionTransitions[XAdESForm.X_L.ordinal()][XAdESForm.A.ordinal()] = aPropsCol; } public void setAcceptUnknownProperties(boolean acceptUnknownProperties) From a7afa61e72a4eb1c54b01deaae7140555b59d92b Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 16 Dec 2012 22:00:55 +0100 Subject: [PATCH 32/84] allow for the validation of timestamp to change time When validating XAdES-A, we need to be able to change verification time after verifying the time stamp in case of all other time stamps, we can do this only after validating all time stamps of specific type, this is ensured by QualifyingPropertiesVerifier Signed-off-by: Tiago Rossi --- .../verification/AllDataObjsTimeStampVerifier.java | 7 +++++++ .../verification/ArchiveTimeStampVerifier.java | 12 ++++++++++++ .../verification/IndivDataObjsTimeStampVerifier.java | 7 +++++++ .../verification/SigAndRefsTimeStampVerifier.java | 10 ++++++++++ .../verification/SignatureTimeStampVerifier.java | 10 ++++++++++ .../xades4j/verification/TimeStampVerifierBase.java | 7 +++++++ 6 files changed, 53 insertions(+) diff --git a/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java b/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java index 903bed2c..aecd0602 100644 --- a/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java @@ -61,4 +61,11 @@ protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( return new AllDataObjsTimeStampProperty(); } + + @Override + protected void updateContextAfterVerification(QualifyingProperty prop, + QualifyingPropertyVerificationContext ctx) + { + // noop + } } diff --git a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java index 16ef1ac1..5cb7598e 100644 --- a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java @@ -258,4 +258,16 @@ private boolean isElementMatchingProperty(Element elem, throw new InternalError("Wrong property class"); } } + + @Override + protected void updateContextAfterVerification(QualifyingProperty prop, + QualifyingPropertyVerificationContext ctx) + { + if (!(prop instanceof ArchiveTimeStampProperty)) + throw new RuntimeException("Can't update time after verification" + + " of ArchiveTimeStamp"); + + ArchiveTimeStampProperty archivTS = (ArchiveTimeStampProperty) prop; + ctx.setCurrentTime(archivTS.getTime()); + } } diff --git a/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java b/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java index a5a0de66..c1aecf5c 100644 --- a/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java @@ -66,4 +66,11 @@ protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( } return prop; } + + @Override + protected void updateContextAfterVerification(QualifyingProperty prop, + QualifyingPropertyVerificationContext ctx) + { + // noop + } } diff --git a/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java b/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java index fb957ad1..acacc2c7 100644 --- a/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java @@ -245,4 +245,14 @@ private boolean isElementMatchingProperty(Element elem, throw new InternalError("Wrong property class"); } } + + @Override + protected void updateContextAfterVerification(QualifyingProperty prop, + QualifyingPropertyVerificationContext ctx) + { + /* + * noop, we can set time only after *all* sigAndRefsTimeStamps have been verified + * this is done in QualifyingPropertiesVerifier + */ + } } diff --git a/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java b/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java index 33760dbe..8a1cfb45 100644 --- a/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java @@ -55,4 +55,14 @@ protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( digestInput.addNode(sigValueElem); return new SignatureTimeStampProperty(); } + + @Override + protected void updateContextAfterVerification(QualifyingProperty prop, + QualifyingPropertyVerificationContext ctx) + { + /* + * noop, we can set time only after *all* SignatureTimeStamps have been verified + * this is done in QualifyingPropertiesVerifier + */ + } } diff --git a/src/main/java/xades4j/verification/TimeStampVerifierBase.java b/src/main/java/xades4j/verification/TimeStampVerifierBase.java index 80b323c9..00db62af 100644 --- a/src/main/java/xades4j/verification/TimeStampVerifierBase.java +++ b/src/main/java/xades4j/verification/TimeStampVerifierBase.java @@ -82,6 +82,9 @@ public final QualifyingProperty verify( // By convention all timestamp property types have a setTime(Date) method Method setTimeMethod = prop.getClass().getMethod("setTime", Date.class); setTimeMethod.invoke(prop, ts); + // should be a noop, only ArchiveTimeStamp should use it to change the + // verification time for all subsequent TimeStamps + updateContextAfterVerification(prop,ctx); return prop; } catch(UnsupportedAlgorithmException ex) @@ -117,6 +120,10 @@ protected abstract QualifyingProperty addPropSpecificTimeStampInputAndCreateProp TimeStampDigestInput digestInput, QualifyingPropertyVerificationContext ctx) throws CannotAddDataToDigestInputException, TimeStampVerificationException; + protected abstract void updateContextAfterVerification( + QualifyingProperty prop, + QualifyingPropertyVerificationContext ctx); + private static TimeStampVerificationException getEx( final Exception ex, String propName) From 5ba94f9dbf2accb775bc53a39943a2b0befd13f0 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 18:37:52 +0100 Subject: [PATCH 33/84] add XAdES-A tests with past timestamps add more detailed tests that test currentTime passing in verification context Signed-off-by: Tiago Rossi --- .../verification/AgedTimeStampTest.java | 418 +++++++++++++++++- 1 file changed, 417 insertions(+), 1 deletion(-) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index fcc3a0b4..34022010 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -54,6 +54,8 @@ import org.apache.xml.security.utils.Constants; import org.bouncycastle.asn1.x509.CRLReason; +import org.bouncycastle.bcpg.sig.RevocationReason; +import org.bouncycastle.bcpg.sig.RevocationReasonTags; import org.bouncycastle.cert.jcajce.JcaCertStore; import org.bouncycastle.util.Store; import org.junit.Test; @@ -134,7 +136,6 @@ public class AgedTimeStampTest private static FullCert test02_X_tsa2Cert; private static X509CRL test02_X_tsaCRL_1; private static X509CRL test02_X_tsaCRL_2; - //private static X509CRL test02_X_tsaCRL_3; private static Store test02_X_userCaStore; private static KeyStore test02_X_userTrustAnchors; private static KeyStore test02_X_tsaTrustAnchors; @@ -146,6 +147,32 @@ public class AgedTimeStampTest private static CertificateValidationProvider test02_userCertMinimalValidationDataProvider; private static TSACertificateValidationProvider test02_tsaCertMinimalValidationDataProvider; + /* + * data for XAdES-A (ArchiveTimeStamp) tests + */ + private static FullCert test03_userCaCert; + private static FullCert test03_userCert; + private static FullCert test03_X_tsaCaCert; + private static FullCert test03_A_tsaCaCert; + private static FullCert test03_T_tsa1Cert; + private static FullCert test03_X_tsa2Cert; + private static FullCert test03_A_tsa3Cert; + private static X509CRL test03_X_tsaCRL_1; + private static X509CRL test03_X_tsaCRL_2; + private static X509CRL test03_A_tsaCRL_3; + private static Store test03_userCaStore; + private static KeyStore test03_userTrustAnchors; + private static KeyStore test03_X_tsaTrustAnchors; + private static KeyStore test03_A_tsaTrustAnchors; + + private static KeyingDataProvider test03_signatureCreationKeyingDataprovider; + private static CertificateValidationProvider test03_userCertValidationDataProviderXCreation; + private static TSACertificateValidationProvider test03_tsaCertValidationDataProviderXCreation; + private static TSACertificateValidationProvider test03_tsaCertValidationDataProviderACreation; + private static TSACertificateValidationProvider test03_tsaCertValidationDataProviderAnow; + private static CertificateValidationProvider test03_userCertMinimalValidationDataProvider; + private static TSACertificateValidationProvider test03_tsaCertMinimalValidationDataProvider; + private static final long ONE_HOUR_IN_MS = 60 * 60 * 1000; static { @@ -173,6 +200,14 @@ public class AgedTimeStampTest createXadesXCerts(now); + /* ****************************************************************************** + * + * Create certs and CRLs for XAdES-A tests + * + * *****************************************************************************/ + + createXadesACerts(now); + } catch (Exception ex) { throw new RuntimeException("static initialization failed", ex); @@ -507,6 +542,195 @@ private static void createXadesXCerts(Date now) throws Exception, emptyCertStore); } + private static void createXadesACerts(Date now) + throws Exception, CertificateEncodingException, KeyStoreException, + IOException, NoSuchAlgorithmException, CertificateException, + InvalidAlgorithmParameterException, NoSuchProviderException + { + test03_userCaCert = FullCert.getCACert( + "RSA", + 1024, + "CN=XAdES-A testing User CA", + new Date(now.getTime() - 24 * ONE_HOUR_IN_MS), + new Date(now.getTime() - 17 * ONE_HOUR_IN_MS), + "SHA256withRSA"); + + test03_X_tsaCaCert = FullCert.getCACert( + "RSA", + 1024, + "CN=XAdES-A testing X form TSA CA", + new Date(now.getTime() - 23 * ONE_HOUR_IN_MS), + new Date(now.getTime() - 9 * ONE_HOUR_IN_MS), + "SHA256withRSA"); + + test03_userCert = test03_userCaCert.createUserCert( + "RSA", + 1024, + "CN=XAdes-A testing User cert", + new Date(now.getTime() - 22 * ONE_HOUR_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS), + new BigInteger("2"), + "SHA256withRSA"); + + test03_T_tsa1Cert = test03_X_tsaCaCert.createTSACert( + "RSA", + 1024, + "CN=XAdES-A testing T form TSA", + new Date(now.getTime() - 21 * ONE_HOUR_IN_MS), + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new BigInteger("2"), + "SHA256withRSA"); + + CRLEntries tsaCaCrlEntries = test03_X_tsaCaCert.new CRLEntries(); + test03_X_tsaCRL_1 = test03_X_tsaCaCert.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 19 * ONE_HOUR_IN_MS), + new Date(now.getTime() - 13 * ONE_HOUR_IN_MS), + new BigInteger("1"), + tsaCaCrlEntries); + + CRLEntries userCaCrlEntries = test03_userCaCert.new CRLEntries(); + userCaCrlEntries.addEntry( + test03_userCert.getCertificate().getSerialNumber(), + new Date(now.getTime() - 18 * ONE_HOUR_IN_MS), + CRLReason.affiliationChanged); + X509CRL userCaCrl = test03_userCaCert.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 18 * ONE_HOUR_IN_MS), + new Date(now.getTime() - 17 * ONE_HOUR_IN_MS), + new BigInteger("1"), + userCaCrlEntries); + + test03_X_tsa2Cert = test03_X_tsaCaCert.createTSACert( + "RSA", + 1024, + "CN=XAdES-A testing X form TSA", + new Date(now.getTime() - 15 * ONE_HOUR_IN_MS), + new Date(now.getTime() - 9 * ONE_HOUR_IN_MS), + new BigInteger("3"), + "SHA256withRSA"); + + tsaCaCrlEntries.addEntry( + test03_T_tsa1Cert.getCertificate().getSerialNumber(), + new Date(now.getTime() - 13 * ONE_HOUR_IN_MS), + CRLReason.affiliationChanged); + test03_X_tsaCRL_2 = test03_X_tsaCaCert.createCRL("SHA256withRSA", + new Date(now.getTime() - 13 * ONE_HOUR_IN_MS), + new Date(now.getTime() - 9 * ONE_HOUR_IN_MS), + new BigInteger("3"), + tsaCaCrlEntries); + + test03_A_tsaCaCert = FullCert.getCACert( + "RSA", + 1024, + "CN=XAdES-A testing A form TSA CA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS), + "SHA256withRSA"); + + test03_A_tsa3Cert = test03_A_tsaCaCert.createTSACert( + "RSA", + 1024, + "CN=XAdES-A testing A form TSA", + new Date(now.getTime() - 11 * ONE_HOUR_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS), + new BigInteger("1"), + "SHA256withRSA"); + + tsaCaCrlEntries = test03_A_tsaCaCert.new CRLEntries(); + test03_A_tsaCRL_3 = test03_A_tsaCaCert.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 1 * ONE_HOUR_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS), + new BigInteger("1"), + tsaCaCrlEntries); + + test03_signatureCreationKeyingDataprovider = new DirectKeyingDataProvider( + test03_userCert.getCertificate(), + test03_userCert.getPrivateKey()); + + test03_userTrustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + test03_userTrustAnchors.load(null); + TrustedCertificateEntry ca = new TrustedCertificateEntry(test03_userCaCert.getCertificate()); + test03_userTrustAnchors.setEntry("ca", ca, null); + + List content = new ArrayList(); + content.add(userCaCrl); + CertStore userIntermCertsAndCrlsXCreation = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); + + test03_userCertValidationDataProviderXCreation = + new PKIXCertificateValidationProvider(test03_userTrustAnchors, + true, + userIntermCertsAndCrlsXCreation); + + test03_X_tsaTrustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + test03_X_tsaTrustAnchors.load(null); + ca = new TrustedCertificateEntry(test03_X_tsaCaCert.getCertificate()); + test03_X_tsaTrustAnchors.setEntry("ca", ca, null); + + content = new ArrayList(); + content.add(test03_T_tsa1Cert.getCertificate()); + content.add(test03_X_tsaCRL_1); + CertStore xTsaIntermCertsAndCrlsXCreation = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); + + test03_tsaCertValidationDataProviderXCreation = + new PKIXTSACertificateValidationProvider( + test03_X_tsaTrustAnchors, + true, + xTsaIntermCertsAndCrlsXCreation); + + test03_A_tsaTrustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + test03_A_tsaTrustAnchors.load(null); + ca = new TrustedCertificateEntry(test03_X_tsaCaCert.getCertificate()); + test03_A_tsaTrustAnchors.setEntry("ca", ca, null); + ca = new TrustedCertificateEntry(test03_A_tsaCaCert.getCertificate()); + test03_A_tsaTrustAnchors.setEntry("newCA", ca, null); + + content = new ArrayList(); + content.add(test03_T_tsa1Cert.getCertificate()); + content.add(test03_X_tsa2Cert.getCertificate()); + content.add(test03_X_tsaCRL_1); + content.add(test03_X_tsaCRL_2); + CertStore aTsaIntermCertsAndCrlsACreation = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); + test03_tsaCertValidationDataProviderACreation = + new PKIXTSACertificateValidationProvider( + test03_A_tsaTrustAnchors, + true, + aTsaIntermCertsAndCrlsACreation); + + content = new ArrayList(); + content.add(test03_A_tsa3Cert.getCertificate()); + content.add(test03_A_tsaCRL_3); + + CertStore aValidationCertsAndCrls = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); + + test03_tsaCertValidationDataProviderAnow = + new PKIXTSACertificateValidationProvider( + test03_A_tsaTrustAnchors, + true, + aValidationCertsAndCrls); + + test03_userCertMinimalValidationDataProvider = + new PKIXCertificateValidationProvider( + test03_userTrustAnchors, + true, + emptyCertStore); + + test03_tsaCertMinimalValidationDataProvider = + new PKIXTSACertificateValidationProvider( + test03_A_tsaTrustAnchors, + true, + emptyCertStore); + } + @Test public void init() throws Exception { @@ -863,6 +1087,198 @@ public void test02_X_ver2() throws Exception assertEquals(XAdESForm.X_L, f); } + /* t + * -24 .User CA validity + * -23 | .TSA CA validity + * -22 | | .User cert validity + * -21 | | | .TSA1 cert validity + * | | | | + * -20 | | | | <---- XAdES-T time stamp (TSA1) + * | | | | + * -19 | | | | .TSA CA 1st CRL + * -18 | | | | | .User CA 1st CRL (user cert revocation) + * | | | | | | + * -17 ' | ' | | ' + * -15 | | | .TSA2 cert validity + * | | | | + * -14 | | | | <---- XAdES-X time stamp (TSA2) + * | | | | + * -13 | | ' | .TSA CA 2nd CRL (TSA1 cert revocation) + * -12 | ' | | .Arch-TSA CA validity + * -11 | | | | .Arch-TSA3 validity + * | | | | | + * -10 | | | | | <---- first XAdES-A time stamp (Arch-TSA1) + * -9 ' ' ' | | + * -1 | | .Arch-TSA CA 1st CRL + * | | | + * 0 | | | <--- (now) validaiton + * | | | + * 1 ' ' ' + */ + + // create basic XAdES-T signed document + @Test + public void test03_T_sig1() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + SurrogateTimeStampTokenProvider.setTSACert(test03_T_tsa1Cert, test03_userCaStore); + SurrogateTimeStampTokenProvider.setTimeAndSerial( + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20), + new BigInteger("1")); + System.out.println("SignatureTimeStamp creation date is " + + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20)); + + Document doc = getDocument("document.xml"); + Element elemToSign = doc.getDocumentElement(); + XadesSigningProfile signer = new XadesTSigningProfile(test03_signatureCreationKeyingDataprovider); + signer.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + new Enveloped(signer.newSigner()).sign(elemToSign); + + outputDocument(doc, "document.aged.test03_T_sig1.xml"); + } + + // extend T form to X form + @Test + public void test03_X_sig2() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + SurrogateTimeStampTokenProvider.setTSACert(test03_X_tsa2Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTimeAndSerial( + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14), + new BigInteger("2")); + + System.out.println("SigAndRefsTimeStamp creation date is " + + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + Document doc = getDocument("document.aged.test03_T_sig1.xml"); + Element signatureNode = getSigElement(doc); + + /* + * extension of signature to X form must be performed in two steps, first we have + * to create the XML with needed Properties (CompleteRevocationRefs and + * CompleteCertificateRefs, that is, C form) and only after that we can add the + * X form time stamp + */ + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test03_userCertValidationDataProviderXCreation, + test03_tsaCertValidationDataProviderXCreation); + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + // extend T to C + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.C, + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + assertEquals(res.getSignatureForm(), XAdESForm.T); + + // extend C to X + res = verifier.verify(signatureNode, null, formExt, XAdESForm.X, + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + assertEquals(res.getSignatureForm(), XAdESForm.C); + + outputDocument(doc, "document.aged.test03_X_sig2.xml"); + } + + // extend X to X-L form + @Test + public void test03_X_sig3() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + Document doc = getDocument("document.aged.test03_X_sig2.xml"); + Element signatureNode = getSigElement(doc); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test03_userCertValidationDataProviderXCreation, + test03_tsaCertValidationDataProviderACreation); + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + // extend X to X-L + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.X_L, new Date(new Date().getTime() - 10 * ONE_HOUR_IN_MS)); + + assertEquals(res.getSignatureForm(), XAdESForm.X); + + outputDocument(doc, "document.aged.test03_X_sig3.xml"); + } + + // extend X-L form to A form + @Test + public void test03_X_sig4() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + SurrogateTimeStampTokenProvider.setTSACert(test03_A_tsa3Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTimeAndSerial( + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 10), + new BigInteger("2")); + + System.out.println("SigAndRefsTimeStamp creation date is " + + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 10)); + + Document doc = getDocument("document.aged.test03_X_sig3.xml"); + Element signatureNode = getSigElement(doc); + + /* + * extension of signature to X form must be performed in two steps, first we have + * to create the XML with needed Properties (CompleteRevocationRefs and + * CompleteCertificateRefs, that is, C form) and only after that we can add the + * X form time stamp + */ + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test03_userCertValidationDataProviderXCreation, + test03_tsaCertValidationDataProviderAnow); + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + // extend X-L to A + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A, + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + assertEquals(res.getSignatureForm(), XAdESForm.X_L); + + outputDocument(doc, "document.aged.test03_A_sig4.xml"); + } + + // verify A form + @Test + public void test03_A_ver1() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + // test verification + XAdESForm f = verifySignature("document.aged.test03_A_sig4.xml", + new XadesVerificationProfile(test03_userCertValidationDataProviderXCreation, + test03_tsaCertValidationDataProviderAnow)); + + assertEquals(XAdESForm.A, f); + } + + // verify A form using minimal validators + @Test + public void test03_A_ver2() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + // verify using minimal data (just CA certificates) + XAdESForm f = verifySignature("document.aged.test03_A_sig4.xml", + new XadesVerificationProfile(test03_userCertMinimalValidationDataProvider, + test03_tsaCertMinimalValidationDataProvider)); + + assertEquals(XAdESForm.A, f); + } + /* * end of tests */ From bde38169383d1710953f07add53d6e7d63a47b36 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 18:57:26 +0100 Subject: [PATCH 34/84] add note about grace time and verification If we want to create small XAdES signatures (KiB wise) then we shouldn't add revocation data that will be useless in future, especially when the verificator enforces grace period for signatures Signed-off-by: Tiago Rossi --- .../verification/AgedTimeStampTest.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index 34022010..2b851fd5 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -1279,6 +1279,66 @@ public void test03_A_ver2() throws Exception assertEquals(XAdESForm.A, f); } + /* + * TODO missing grace period support + * The library should support enforcing grace period, but what's more important, it + * should add only necessary CRLs when creating revocation information related + * properties. If that's not performed, then CRLs that don't help in later + * validation will be added causing the file size to grow needlessly. + + time + . + | <- Signature creation time + | + | <- SignatureTimeStamp creation time (XAdES-T) + | + + | | + | | grace period for Signature + | | + | + + | <- earliest time a CRL will make the Signature non-repudiable + | + | <- publishing of CRL for Signature certificate + | <- earliest time a usable XAdES-C can be created + / + / + | <- SigAndRefsTimeStamp creation time (XAdES-X) + | + + | | + | | grace period for SignatureTimeStamp + | | + | + + | <- earliest time a CRL will make SignatureTimeStamp non-repudiable + | + | <- publishing of CRL for SignatureTimeStamp certificate + | <- earliest time a usable XAdES-X-L can be created + / + / + | <- 1st ArchiveTimeStamp creation time (XAdES-A) + | + + | | + | | grace period for SigAndRefsTimeSamp + | | + | + + | <- earliest time a CRL will make SigAndRefsTimeStamp non-repudiable + | + | <- publishing of CRL for SigAndRefsTimeStamp + | <- earliest time TimeStampValidationData can be created (XAdES-A-VD) + / + / + | <- 2nd ArchiveTimeStamp creation time (XAdES-A) + | + + | | + | | grace period for 1st ArchiveTimeStamp + | | + | + + | <- earliest time a CRL will make 1st ArchiveTimeStamp non-repudiable + | + | <- publishing of CRL for 1st ArchiveTimeStamp + | <- earliest time TimeStampValidationData for 1st ArchiveTimeStamp can be created + ' + + */ /* * end of tests */ From d446f0883f235bab0d4876f70df1baf0a44076bb Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 19:52:37 +0100 Subject: [PATCH 35/84] add TimeStampValidationData property Signed-off-by: Tiago Rossi --- .../TimeStampValidationDataProperty.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/main/java/xades4j/properties/TimeStampValidationDataProperty.java diff --git a/src/main/java/xades4j/properties/TimeStampValidationDataProperty.java b/src/main/java/xades4j/properties/TimeStampValidationDataProperty.java new file mode 100644 index 00000000..9d546bc9 --- /dev/null +++ b/src/main/java/xades4j/properties/TimeStampValidationDataProperty.java @@ -0,0 +1,75 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.properties; + +import java.security.cert.X509CRL; +import java.security.cert.X509Certificate; +import java.util.Collection; + +/** + * The {@code TimeStampValidationData} is an optional unsigned property that extends + * the XAdES-A format with information needed to verify previously signed time stamps. + * There can be multiple occurrences of this property in signature. + *

+ * In principle, the {@code TimeStampValidationData} element contains the full set of + * certificates and revocation information (CRLs or OCSP responses) that have been used + * to validate previous time stamp (XAdES-X time stamp in case of first + * {@code TimeStampValidationData} added after creation of first + * {@code ArchiveTimeStamp}). + * @author Hubert Kario + */ +public class TimeStampValidationDataProperty extends UnsignedSignatureProperty +{ + // it is in xadesv141 namespace though! + public static final String PROP_NAME = "TimeStampValidationData"; + private final Collection certificateValues; + private final Collection crls; + + /** + * Both parameters can be {@code null} or empty, but not at the same time + * + * @param certificates can be null + * @param crls can be null + */ + public TimeStampValidationDataProperty(Collection certificates, + Collection crls) + { + if ((certificates == null && crls == null) || + (certificates.isEmpty() && crls.isEmpty())) + throw new NullPointerException("Both parameters can't be null/empty"); + + this.certificateValues = certificates; + this.crls = crls; + } + + public Collection getCrls() + { + return crls; + } + + public Collection getCertificates() + { + return certificateValues; + } + + @Override + public String getName() + { + return PROP_NAME; + } + +} From 176413d9f81ad01dc412b88024ff1ad6b8e2064d Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 21:09:17 +0100 Subject: [PATCH 36/84] add support for XAdES 1.4.1 ValidationDataType Signed-off-by: Tiago Rossi --- .../data/BaseValidationDataData.java | 59 +++++++++++++++++++ .../data/CertificateValuesData.java | 11 ++++ .../properties/data/RevocationValuesData.java | 11 ++++ 3 files changed, 81 insertions(+) create mode 100644 src/main/java/xades4j/properties/data/BaseValidationDataData.java diff --git a/src/main/java/xades4j/properties/data/BaseValidationDataData.java b/src/main/java/xades4j/properties/data/BaseValidationDataData.java new file mode 100644 index 00000000..ee81677b --- /dev/null +++ b/src/main/java/xades4j/properties/data/BaseValidationDataData.java @@ -0,0 +1,59 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.properties.data; + +import java.util.Collection; + +public class BaseValidationDataData implements PropertyDataObject +{ + private final CertificateValuesData certificateValues; + private final RevocationValuesData revocationData; + + public BaseValidationDataData( + Collection certificates, + Collection revocationData) + { + this.certificateValues = new CertificateValuesData(certificates); + this.revocationData = new RevocationValuesData(revocationData); + } + + public BaseValidationDataData() + { + this.certificateValues = new CertificateValuesData(); + this.revocationData = new RevocationValuesData(); + } + + public void addCertificateData(byte[] d) + { + this.certificateValues.addData(d); + } + + public void addRevocationData(byte[] d) + { + this.revocationData.addData(d); + } + + public Collection getCertificateData() + { + return certificateValues.getData(); + } + + public Collection getRevocationData() + { + return revocationData.getData(); + } +} diff --git a/src/main/java/xades4j/properties/data/CertificateValuesData.java b/src/main/java/xades4j/properties/data/CertificateValuesData.java index 86104ed2..a03f6ee0 100644 --- a/src/main/java/xades4j/properties/data/CertificateValuesData.java +++ b/src/main/java/xades4j/properties/data/CertificateValuesData.java @@ -16,10 +16,21 @@ */ package xades4j.properties.data; +import java.util.Collection; + /** * * @author Luís */ public final class CertificateValuesData extends BaseEncapsulatedPKIData { + public CertificateValuesData() + { + super(); + } + + public CertificateValuesData(Collection certificates) + { + super(certificates); + } } diff --git a/src/main/java/xades4j/properties/data/RevocationValuesData.java b/src/main/java/xades4j/properties/data/RevocationValuesData.java index a42a5da8..42fc0c28 100644 --- a/src/main/java/xades4j/properties/data/RevocationValuesData.java +++ b/src/main/java/xades4j/properties/data/RevocationValuesData.java @@ -16,10 +16,21 @@ */ package xades4j.properties.data; +import java.util.Collection; + /** * * @author Luís */ public class RevocationValuesData extends BaseEncapsulatedPKIData { + public RevocationValuesData() + { + super(); + } + + public RevocationValuesData(Collection revocationData) + { + super(revocationData); + } } From a2c09e2d0335c9fca1e598283082c6ef3a26748e Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 21:11:07 +0100 Subject: [PATCH 37/84] unmarshalling of TimeStampValidationData property Signed-off-by: Tiago Rossi --- .../data/TimeStampValidationDataData.java | 22 +++++ .../HybridQualifPropsDataCollectorImpl.java | 11 +++ .../QualifPropsDataCollectorImpl.java | 7 ++ .../XmlUnsignedSignaturePropertiesType.java | 35 ++++++- ...omXmlTimeStampValidationDataConverter.java | 91 +++++++++++++++++++ ...ybridQualifyingPropertiesUnmarshaller.java | 18 +++- .../QualifyingPropertiesDataCollector.java | 4 + .../unmarshalling/UnsignedSigPropsModule.java | 1 + 8 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 src/main/java/xades4j/properties/data/TimeStampValidationDataData.java create mode 100644 src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java diff --git a/src/main/java/xades4j/properties/data/TimeStampValidationDataData.java b/src/main/java/xades4j/properties/data/TimeStampValidationDataData.java new file mode 100644 index 00000000..af4bafda --- /dev/null +++ b/src/main/java/xades4j/properties/data/TimeStampValidationDataData.java @@ -0,0 +1,22 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.properties.data; + +public class TimeStampValidationDataData extends BaseValidationDataData +{ + +} diff --git a/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java index 1fa0ba25..cd2911f3 100644 --- a/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/HybridQualifPropsDataCollectorImpl.java @@ -43,6 +43,7 @@ import xades4j.properties.data.SignerRoleData; import xades4j.properties.data.SigningCertificateData; import xades4j.properties.data.SigningTimeData; +import xades4j.properties.data.TimeStampValidationDataData; import xades4j.utils.PropertiesList; import xades4j.utils.PropertiesSet; import xades4j.xml.unmarshalling.QualifyingPropertiesDataCollector; @@ -220,6 +221,16 @@ public void addArchiveTimeStamp(ArchiveTimeStampData tsData) unsignedSigProperties.add(tsData); } + @Override + public void addTimeStampValidationDataData( + TimeStampValidationDataData timeStampValidationDataData) + { + if (unsignedSigProperties.size() != unsignedSigPropertiesElements.size()) + throw new IllegalStateException("No Element linked to previous property"); + + unsignedSigProperties.add(timeStampValidationDataData); + } + List getUnsignedPropertiesData() { return unsignedSigProperties.getProperties(); diff --git a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java index efee810a..017d7e13 100644 --- a/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java +++ b/src/main/java/xades4j/verification/QualifPropsDataCollectorImpl.java @@ -36,6 +36,7 @@ import xades4j.properties.data.SignaturePolicyData; import xades4j.properties.data.SignatureTimeStampData; import xades4j.properties.data.SignerRoleData; +import xades4j.properties.data.TimeStampValidationDataData; import xades4j.utils.PropertiesSet; import xades4j.properties.data.CommitmentTypeData; import xades4j.properties.data.DataObjectFormatData; @@ -200,4 +201,10 @@ public void addArchiveTimeStamp(ArchiveTimeStampData tsData) propsData.add(tsData); } + @Override + public void addTimeStampValidationDataData( + TimeStampValidationDataData timeStampValidationDataData) + { + propsData.add(timeStampValidationDataData); + } } diff --git a/src/main/java/xades4j/xml/bind/xades/XmlUnsignedSignaturePropertiesType.java b/src/main/java/xades4j/xml/bind/xades/XmlUnsignedSignaturePropertiesType.java index 70d13d6f..3610c4da 100644 --- a/src/main/java/xades4j/xml/bind/xades/XmlUnsignedSignaturePropertiesType.java +++ b/src/main/java/xades4j/xml/bind/xades/XmlUnsignedSignaturePropertiesType.java @@ -41,7 +41,8 @@ * <element name="RevocationValues" type="{http://uri.etsi.org/01903/v1.3.2#}RevocationValuesType" minOccurs="0"/> * <element name="AttrAuthoritiesCertValues" type="{http://uri.etsi.org/01903/v1.3.2#}CertificateValuesType" minOccurs="0"/> * <element name="AttributeRevocationValues" type="{http://uri.etsi.org/01903/v1.3.2#}RevocationValuesType" minOccurs="0"/> - * <element name="ArchiveTimeStamp" type="{http://uri.etsi.org/01903/v1.4.2#}XAdESTimeStampType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="ArchiveTimeStamp" type="{http://uri.etsi.org/01903/v1.4.1#}XAdESTimeStampType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="TimeStampValidationData" type="{http://uri.etsi.org/01903/v1.4.1#}ValidationDataType" maxOccurs="unbounded" minOccurs="0"/> * <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/> * </sequence> * <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" /> @@ -68,6 +69,7 @@ "attrAuthoritiesCertValues", "attributeRevocationValues", "archiveTimeStamp", + "timeStampValidationData", "any" }) public class XmlUnsignedSignaturePropertiesType @@ -98,6 +100,8 @@ public class XmlUnsignedSignaturePropertiesType protected XmlRevocationValuesType attributeRevocationValues; @XmlElement(name = "ArchiveTimeStamp") protected List archiveTimeStamp; + @XmlElement(name = "TimeStampValidationData") + protected List timeStampValidationData; @XmlAnyElement(lax = true) protected List any; @XmlAttribute(name = "Id") @@ -460,6 +464,35 @@ public List getArchiveTimeStamp() } /** + * Gets the value of the timeStampValidationData property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the archiveTimeStamp property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTimeStampValidationData().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link XmlValidationDataType } + * + * + */ + public List getTimeStampValidationData() + { + if (timeStampValidationData == null) + timeStampValidationData = new ArrayList(); + return this.timeStampValidationData; + } + + /** * Gets the value of the any property. * *

diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java new file mode 100644 index 00000000..2202c9b6 --- /dev/null +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java @@ -0,0 +1,91 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.unmarshalling; + +import java.util.List; + +import xades4j.properties.data.TimeStampValidationDataData; +import xades4j.xml.bind.xades.XmlAnyType; +import xades4j.xml.bind.xades.XmlCRLValuesType; +import xades4j.xml.bind.xades.XmlCertificateValuesType; +import xades4j.xml.bind.xades.XmlEncapsulatedPKIDataType; +import xades4j.xml.bind.xades.XmlRevocationValuesType; +import xades4j.xml.bind.xades.XmlUnsignedSignaturePropertiesType; +import xades4j.xml.bind.xades.XmlValidationDataType; + +public class FromXmlTimeStampValidationDataConverter implements + UnsignedSigPropFromXmlConv +{ + + @Override + public void convertFromObjectTree( + XmlUnsignedSignaturePropertiesType xmlProps, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { + List xmlTimeStampValidationData = + xmlProps.getTimeStampValidationData(); + convertFromObject(xmlTimeStampValidationData, propertyDataCollector); + } + + public void convertFromObject( + List xmlTimeStampValidationData, + QualifyingPropertiesDataCollector propertyDataCollector) + throws PropertyUnmarshalException + { + if (null == xmlTimeStampValidationData || xmlTimeStampValidationData.isEmpty()) + return; + + TimeStampValidationDataData timeStampValidationDataData = + new TimeStampValidationDataData(); + + for (XmlValidationDataType xmlVDT : xmlTimeStampValidationData) + { + XmlCertificateValuesType xmlCertificateValues = xmlVDT.getCertificateValues(); + + List certValues = xmlCertificateValues.getEncapsulatedX509CertificateOrOtherCertificate(); + for (Object item : certValues) + { + if (item instanceof XmlEncapsulatedPKIDataType) + { + XmlEncapsulatedPKIDataType cert = (XmlEncapsulatedPKIDataType) item; + timeStampValidationDataData.addCertificateData(cert.getValue()); + } + if (item instanceof XmlAnyType) + throw new PropertyUnmarshalException("Property not supprted", "OtherCertificate"); + } + + XmlRevocationValuesType xmlRevocationValues = xmlVDT.getRevocationValues(); + XmlCRLValuesType crlValues = xmlRevocationValues.getCRLValues(); + List crls = crlValues.getEncapsulatedCRLValue(); + for (XmlEncapsulatedPKIDataType crl : crls) + { + timeStampValidationDataData.addRevocationData(crl.getValue()); + } + + // check for unsupported data + if (xmlRevocationValues.getOCSPValues() != null) + throw new PropertyUnmarshalException("OCSP responses are unsupported", + "TimeStampValidationData"); + if (xmlRevocationValues.getOtherValues() != null) + throw new PropertyUnmarshalException("Other (not CRL and not OCSP) " + + "certificate revocation values unsupported", "TimeStampValidationData"); + } + + propertyDataCollector.addTimeStampValidationDataData(timeStampValidationDataData); + } +} diff --git a/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java b/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java index b073efe3..80e5dc14 100644 --- a/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java +++ b/src/main/java/xades4j/xml/unmarshalling/HybridQualifyingPropertiesUnmarshaller.java @@ -41,6 +41,7 @@ import xades4j.properties.RevocationValuesProperty; import xades4j.properties.SigAndRefsTimeStampProperty; import xades4j.properties.SignatureTimeStampProperty; +import xades4j.properties.TimeStampValidationDataProperty; import xades4j.properties.UnsignedSignatureProperty; import xades4j.xml.bind.xades.XmlCertificateValuesType; import xades4j.xml.bind.xades.XmlCompleteCertificateRefsType; @@ -48,6 +49,7 @@ import xades4j.xml.bind.xades.XmlCounterSignatureType; import xades4j.xml.bind.xades.XmlQualifyingPropertiesType; import xades4j.xml.bind.xades.XmlRevocationValuesType; +import xades4j.xml.bind.xades.XmlValidationDataType; import xades4j.xml.bind.xades.XmlXAdESTimeStampType; public final class HybridQualifyingPropertiesUnmarshaller implements @@ -188,7 +190,8 @@ private boolean isNodeTheProperty(Node node, Class xmlTimeStampValidationDataElem = + unmarshallElement(node, XmlValidationDataType.class); + + FromXmlTimeStampValidationDataConverter tsValidationDataConverter = + new FromXmlTimeStampValidationDataConverter(); + + List xmlTimeStampValidationData = + new ArrayList(); + xmlTimeStampValidationData.add(xmlTimeStampValidationDataElem.getValue()); + tsValidationDataConverter.convertFromObject(xmlTimeStampValidationData , + propertyDataCollector); } else if (!acceptUnknown) // not recognized property throw new UnmarshalException("Unknown unsigned signature property: " + node.getLocalName()); diff --git a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java index c2d798a4..79eddf74 100644 --- a/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java +++ b/src/main/java/xades4j/xml/unmarshalling/QualifyingPropertiesDataCollector.java @@ -42,6 +42,7 @@ import xades4j.properties.data.SignaturePolicyData; import xades4j.properties.data.SignatureTimeStampData; import xades4j.properties.data.SignerRoleData; +import xades4j.properties.data.TimeStampValidationDataData; /** * Passed to a {@link QualifyingPropertiesUnmarshaller} to collect the property @@ -101,6 +102,9 @@ public void setAttributeRevocationValues( public void addArchiveTimeStamp(ArchiveTimeStampData tsData); + public void addTimeStampValidationDataData( + TimeStampValidationDataData timeStampValidationDataData); + public void linkPropertyToElem(Element node); /** diff --git a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java index 97b3e9a4..cfb3cfd8 100644 --- a/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java +++ b/src/main/java/xades4j/xml/unmarshalling/UnsignedSigPropsModule.java @@ -42,6 +42,7 @@ class UnsignedSigPropsModule extends UnmarshallerModule Date: Mon, 17 Dec 2012 21:43:42 +0100 Subject: [PATCH 38/84] add ValidationData property structure verifier Signed-off-by: Tiago Rossi --- .../BaseValidationDataStructureVerifier.java | 38 +++++++++++++++++++ ...ropertiesDataObjectsStructureVerifier.java | 4 ++ 2 files changed, 42 insertions(+) create mode 100644 src/main/java/xades4j/properties/data/BaseValidationDataStructureVerifier.java diff --git a/src/main/java/xades4j/properties/data/BaseValidationDataStructureVerifier.java b/src/main/java/xades4j/properties/data/BaseValidationDataStructureVerifier.java new file mode 100644 index 00000000..292e3f7d --- /dev/null +++ b/src/main/java/xades4j/properties/data/BaseValidationDataStructureVerifier.java @@ -0,0 +1,38 @@ +package xades4j.properties.data; + +import java.util.Collection; + +public class BaseValidationDataStructureVerifier implements + PropertyDataObjectStructureVerifier +{ + private final String propName; + + BaseValidationDataStructureVerifier(String propName) + { + this.propName = propName; + } + + @Override + public void verifyStructure(PropertyDataObject propData) + throws PropertyDataStructureException + { + BaseValidationDataData validationData = (BaseValidationDataData) propData; + + Collection certData = validationData.getCertificateData(); + Collection revocData = validationData.getRevocationData(); + if ((certData == null || certData.isEmpty()) && (revocData == null || revocData.isEmpty())) + throw new PropertyDataStructureException( + "Neither certificate nor revocation data provided", propName); + + for (byte[] d : certData) + { + if (d == null) + throw new PropertyDataStructureException("null cert data", propName); + } + for (byte[] d : revocData) + { + if (d == null) + throw new PropertyDataStructureException("null revoc data", propName); + } + } +} diff --git a/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java b/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java index 427a496b..c484240e 100644 --- a/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java +++ b/src/main/java/xades4j/properties/data/PropertiesDataObjectsStructureVerifier.java @@ -33,6 +33,7 @@ import xades4j.properties.SigAndRefsTimeStampProperty; import xades4j.properties.SignatureTimeStampProperty; import xades4j.properties.SigningCertificateProperty; +import xades4j.properties.TimeStampValidationDataProperty; /** * @@ -100,6 +101,9 @@ public class PropertiesDataObjectsStructureVerifier structureVerifiers.put(ArchiveTimeStampData.class, new BaseXAdESTimeStampDataStructureVerifier(ArchiveTimeStampProperty.PROP_NAME)); + structureVerifiers.put(TimeStampValidationDataData.class, + new BaseValidationDataStructureVerifier(TimeStampValidationDataProperty.PROP_NAME)); + structureVerifiers.put(GenericDOMData.class, new GenericDOMDataStructureVerifier()); } From 4e4edc48c86c9a3fc826c080208821ea254773ad Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 21:47:17 +0100 Subject: [PATCH 39/84] add TimeStampValidationData verifier Signed-off-by: Tiago Rossi --- .../data/BaseValidationDataData.java | 16 +-- .../BaseValidationDataStructureVerifier.java | 2 +- .../DefaultVerificationBindingsModule.java | 2 + ...mpValidationDataVerificationException.java | 41 +++++++ .../TimeStampValidationDataVerifier.java | 103 ++++++++++++++++++ ...omXmlTimeStampValidationDataConverter.java | 2 +- 6 files changed, 156 insertions(+), 10 deletions(-) create mode 100644 src/main/java/xades4j/verification/TimeStampValidationDataVerificationException.java create mode 100644 src/main/java/xades4j/verification/TimeStampValidationDataVerifier.java diff --git a/src/main/java/xades4j/properties/data/BaseValidationDataData.java b/src/main/java/xades4j/properties/data/BaseValidationDataData.java index ee81677b..02162078 100644 --- a/src/main/java/xades4j/properties/data/BaseValidationDataData.java +++ b/src/main/java/xades4j/properties/data/BaseValidationDataData.java @@ -21,20 +21,20 @@ public class BaseValidationDataData implements PropertyDataObject { private final CertificateValuesData certificateValues; - private final RevocationValuesData revocationData; + private final RevocationValuesData crlData; public BaseValidationDataData( Collection certificates, - Collection revocationData) + Collection crlData) { this.certificateValues = new CertificateValuesData(certificates); - this.revocationData = new RevocationValuesData(revocationData); + this.crlData = new RevocationValuesData(crlData); } public BaseValidationDataData() { this.certificateValues = new CertificateValuesData(); - this.revocationData = new RevocationValuesData(); + this.crlData = new RevocationValuesData(); } public void addCertificateData(byte[] d) @@ -42,9 +42,9 @@ public void addCertificateData(byte[] d) this.certificateValues.addData(d); } - public void addRevocationData(byte[] d) + public void addCRLData(byte[] d) { - this.revocationData.addData(d); + this.crlData.addData(d); } public Collection getCertificateData() @@ -52,8 +52,8 @@ public Collection getCertificateData() return certificateValues.getData(); } - public Collection getRevocationData() + public Collection getCRLData() { - return revocationData.getData(); + return crlData.getData(); } } diff --git a/src/main/java/xades4j/properties/data/BaseValidationDataStructureVerifier.java b/src/main/java/xades4j/properties/data/BaseValidationDataStructureVerifier.java index 292e3f7d..5d416e4b 100644 --- a/src/main/java/xades4j/properties/data/BaseValidationDataStructureVerifier.java +++ b/src/main/java/xades4j/properties/data/BaseValidationDataStructureVerifier.java @@ -19,7 +19,7 @@ public void verifyStructure(PropertyDataObject propData) BaseValidationDataData validationData = (BaseValidationDataData) propData; Collection certData = validationData.getCertificateData(); - Collection revocData = validationData.getRevocationData(); + Collection revocData = validationData.getCRLData(); if ((certData == null || certData.isEmpty()) && (revocData == null || revocData.isEmpty())) throw new PropertyDataStructureException( "Neither certificate nor revocation data provided", propName); diff --git a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java index 42106957..924a24a9 100644 --- a/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java +++ b/src/main/java/xades4j/verification/DefaultVerificationBindingsModule.java @@ -48,6 +48,7 @@ import xades4j.properties.data.SignerRoleData; import xades4j.properties.data.SigningCertificateData; import xades4j.properties.data.SigningTimeData; +import xades4j.properties.data.TimeStampValidationDataData; import xades4j.providers.impl.DefaultMessageDigestProvider; import xades4j.providers.impl.DefaultTimeStampVerificationProvider; import xades4j.providers.MessageDigestEngineProvider; @@ -127,6 +128,7 @@ public InputStream getSignaturePolicyDocumentStream( bindBuiltInVerifier(RevocationValuesData.class, RevocationValuesVerifier.class); bindBuiltInVerifier(AttributeRevocationValuesData.class, AttributeRevocationValuesVerifier.class); bindBuiltInVerifier(ArchiveTimeStampData.class, ArchiveTimeStampVerifier.class); + bindBuiltInVerifier(TimeStampValidationDataData.class, TimeStampValidationDataVerifier.class); MapBinder unkownElemsBinder = MapBinder.newMapBinder(binder(), QName.class, QualifyingPropertyVerifier.class); unkownElemsBinder diff --git a/src/main/java/xades4j/verification/TimeStampValidationDataVerificationException.java b/src/main/java/xades4j/verification/TimeStampValidationDataVerificationException.java new file mode 100644 index 00000000..ff865be7 --- /dev/null +++ b/src/main/java/xades4j/verification/TimeStampValidationDataVerificationException.java @@ -0,0 +1,41 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +public class TimeStampValidationDataVerificationException extends + InvalidPropertyException +{ + private static final long serialVersionUID = -5708135575194239088L; + + public TimeStampValidationDataVerificationException(Throwable ex) + { + super(ex); + } + + @Override + protected String getVerificationMessage() + { + return "Can't verify TimeStamp validation data"; + } + + @Override + public String getPropertyName() + { + return "TimeStampValidationData"; + } + +} diff --git a/src/main/java/xades4j/verification/TimeStampValidationDataVerifier.java b/src/main/java/xades4j/verification/TimeStampValidationDataVerifier.java new file mode 100644 index 00000000..07812069 --- /dev/null +++ b/src/main/java/xades4j/verification/TimeStampValidationDataVerifier.java @@ -0,0 +1,103 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.security.cert.CRLException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509CRL; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.w3c.dom.Element; + +import xades4j.properties.QualifyingProperty; +import xades4j.properties.TimeStampValidationDataProperty; +import xades4j.properties.data.TimeStampValidationDataData; + +public class TimeStampValidationDataVerifier implements + QualifyingPropertyVerifier +{ + @Override + public QualifyingProperty verify(TimeStampValidationDataData propData, + QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + Collection rawCertificateData = propData.getCertificateData(); + Collection rawRevocationData = propData.getCRLData(); + + CertificateFactory certFactory; + try + { + certFactory = CertificateFactory.getInstance("X509"); + } catch (CertificateException e) + { + throw new TimeStampValidationDataVerificationException(e); + } + + List certificates = new ArrayList(); + for (byte[] cert : rawCertificateData) + { + InputStream inStream = new ByteArrayInputStream(cert); + try + { + certificates.add((X509Certificate) certFactory.generateCertificate(inStream)); + } catch (CertificateException e) + { + throw new TimeStampValidationDataVerificationException(e); + } + } + + List crls = new ArrayList(); + for (byte[] crl : rawRevocationData) + { + InputStream inStream = new ByteArrayInputStream(crl); + try + { + crls.add((X509CRL) certFactory.generateCRL(inStream)); + } catch (CRLException e) + { + throw new TimeStampValidationDataVerificationException(e); + } + } + + addValidationDataToValidationProvider(certificates, crls, ctx); + + return new TimeStampValidationDataProperty(certificates, crls); + } + + private void addValidationDataToValidationProvider( + List certificates, List crls, + QualifyingPropertyVerificationContext ctx) + { + ctx.addAttributeCertificates(certificates); + ctx.addAttributeCRLs(crls); + } + + @Override + public QualifyingProperty verify(TimeStampValidationDataData propData, + Element elem, QualifyingPropertyVerificationContext ctx) + throws InvalidPropertyException + { + return verify(propData, ctx); + } + +} diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java index 2202c9b6..27de6261 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java @@ -74,7 +74,7 @@ public void convertFromObject( List crls = crlValues.getEncapsulatedCRLValue(); for (XmlEncapsulatedPKIDataType crl : crls) { - timeStampValidationDataData.addRevocationData(crl.getValue()); + timeStampValidationDataData.addCRLData(crl.getValue()); } // check for unsupported data From 62d6066dede113927331b90bd111eb39c0860cc8 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 13:56:53 +0100 Subject: [PATCH 40/84] emphisise that TimeStampValidationData is from 1.4.1 Signed-off-by: Tiago Rossi --- src/main/java/xades4j/xml/bind/xades/ObjectFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/xades4j/xml/bind/xades/ObjectFactory.java b/src/main/java/xades4j/xml/bind/xades/ObjectFactory.java index 91ff4fc3..24ab6f98 100644 --- a/src/main/java/xades4j/xml/bind/xades/ObjectFactory.java +++ b/src/main/java/xades4j/xml/bind/xades/ObjectFactory.java @@ -69,7 +69,7 @@ public class ObjectFactory { private final static QName _SigAndRefsTimeStamp_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "SigAndRefsTimeStamp"); private final static QName _DataObjectFormat_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "DataObjectFormat"); private final static QName _AttributeCertificateRefs_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "AttributeCertificateRefs"); - private final static QName _TimeStampValidationData_QNAME = new QName("http://uri.etsi.org/01903/v1.4.1#", "TimeStampValidationData"); + private final static QName _TimeStampValidationDataV1_4_1_QNAME = new QName("http://uri.etsi.org/01903/v1.4.1#", "TimeStampValidationData"); private final static QName _SignedProperties_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "SignedProperties"); private final static QName _CompleteCertificateRefs_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "CompleteCertificateRefs"); private final static QName _AttributeRevocationRefs_QNAME = new QName("http://uri.etsi.org/01903/v1.3.2#", "AttributeRevocationRefs"); @@ -819,8 +819,8 @@ public JAXBElement createAttributeCertificateRef * */ @XmlElementDecl(namespace = "http://uri.etsi.org/01903/v1.4.1#", name = "TimeStampValidationData") - public JAXBElement createTimeStampValidationData(XmlValidationDataType value) { - return new JAXBElement(_TimeStampValidationData_QNAME, XmlValidationDataType.class, null, value); + public JAXBElement createTimeStampValidationDataV1_4_1(XmlValidationDataType value) { + return new JAXBElement(_TimeStampValidationDataV1_4_1_QNAME, XmlValidationDataType.class, null, value); } /** From 8a64130b66a0451e9be646a6a5d19328292910fa Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 22:19:56 +0100 Subject: [PATCH 41/84] add TimeStampValidationData marshaller Signed-off-by: Tiago Rossi --- .../DefaultUnsignedPropertiesMarshaller.java | 2 + ...ToXmlTimeStampValidationDataConverter.java | 83 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 src/main/java/xades4j/xml/marshalling/ToXmlTimeStampValidationDataConverter.java diff --git a/src/main/java/xades4j/xml/marshalling/DefaultUnsignedPropertiesMarshaller.java b/src/main/java/xades4j/xml/marshalling/DefaultUnsignedPropertiesMarshaller.java index 24663ed7..bd2fcbf8 100644 --- a/src/main/java/xades4j/xml/marshalling/DefaultUnsignedPropertiesMarshaller.java +++ b/src/main/java/xades4j/xml/marshalling/DefaultUnsignedPropertiesMarshaller.java @@ -29,6 +29,7 @@ import xades4j.properties.data.RevocationValuesData; import xades4j.properties.data.SigAndRefsTimeStampData; import xades4j.properties.data.SignatureTimeStampData; +import xades4j.properties.data.TimeStampValidationDataData; import xades4j.xml.bind.xades.ObjectFactory; import xades4j.xml.bind.xades.XmlUnsignedDataObjectPropertiesType; import xades4j.xml.bind.xades.XmlUnsignedPropertiesType; @@ -61,6 +62,7 @@ class DefaultUnsignedPropertiesMarshaller super.putConverter(RevocationValuesData.class, new ToXmlRevocationValuesConverter()); super.putConverter(AttributeRevocationValuesData.class, new ToXmlAttributeRevocationValuesConverter()); super.putConverter(ArchiveTimeStampData.class, new ToXmlArchiveTimeStampConverter(algorithmsParametersMarshallingProvider)); + super.putConverter(TimeStampValidationDataData.class, new ToXmlTimeStampValidationDataConverter()); /* The CounterSignature property is marshalled directly using DOM because * it is easier that way (it is represented by a GenericDOMData instance). */ diff --git a/src/main/java/xades4j/xml/marshalling/ToXmlTimeStampValidationDataConverter.java b/src/main/java/xades4j/xml/marshalling/ToXmlTimeStampValidationDataConverter.java new file mode 100644 index 00000000..f14fcf36 --- /dev/null +++ b/src/main/java/xades4j/xml/marshalling/ToXmlTimeStampValidationDataConverter.java @@ -0,0 +1,83 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.xml.marshalling; + +import java.util.Collection; +import java.util.List; + +import javax.xml.bind.JAXBElement; + +import org.w3c.dom.Document; + +import xades4j.properties.data.PropertyDataObject; +import xades4j.properties.data.TimeStampValidationDataData; +import xades4j.xml.bind.xades.ObjectFactory; +import xades4j.xml.bind.xades.XmlCRLValuesType; +import xades4j.xml.bind.xades.XmlCertificateValuesType; +import xades4j.xml.bind.xades.XmlEncapsulatedPKIDataType; +import xades4j.xml.bind.xades.XmlRevocationValuesType; +import xades4j.xml.bind.xades.XmlUnsignedPropertiesType; +import xades4j.xml.bind.xades.XmlValidationDataType; + +public class ToXmlTimeStampValidationDataConverter implements + UnsignedPropertyDataToXmlConverter +{ + + @Override + public void convertIntoObjectTree(PropertyDataObject propData, + XmlUnsignedPropertiesType xmlProps, Document doc) + { + Collection certValues = ((TimeStampValidationDataData) propData).getCertificateData(); + Collection crlValues = ((TimeStampValidationDataData) propData).getCRLData(); + + ObjectFactory objectFactory = new ObjectFactory(); + + XmlValidationDataType xmlValidationDataType = objectFactory.createXmlValidationDataType(); + if (certValues != null && ! certValues.isEmpty()) + { + XmlCertificateValuesType xmlCertificateValues = new XmlCertificateValuesType(); + List certList = + xmlCertificateValues.getEncapsulatedX509CertificateOrOtherCertificate(); + for (byte[] cert : certValues) + { + XmlEncapsulatedPKIDataType xmlEncodedCert = new XmlEncapsulatedPKIDataType(); + xmlEncodedCert.setValue(cert); + certList.add(xmlEncodedCert); + } + xmlValidationDataType.setCertificateValues(xmlCertificateValues); + } + + if (crlValues != null && ! crlValues.isEmpty()) + { + XmlRevocationValuesType xmlRevocationValuesType = new XmlRevocationValuesType(); + XmlCRLValuesType xmlCRLValuesType = new XmlCRLValuesType(); + List crlList = xmlCRLValuesType.getEncapsulatedCRLValue(); + for (byte[] crl : crlValues) + { + XmlEncapsulatedPKIDataType xmlEncodedCrl = new XmlEncapsulatedPKIDataType(); + xmlEncodedCrl.setValue(crl); + crlList.add(xmlEncodedCrl); + } + xmlRevocationValuesType.setCRLValues(xmlCRLValuesType); + xmlValidationDataType.setRevocationValues(xmlRevocationValuesType); + } + + JAXBElement xmlTimeStampValidationData = + objectFactory.createTimeStampValidationDataV1_4_1(xmlValidationDataType); + xmlProps.getUnsignedSignatureProperties().getAny().add(xmlTimeStampValidationData); + } +} From 92986f7c26727b325c3aed11000d4e21d679b8b3 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 22:29:52 +0100 Subject: [PATCH 42/84] TimeStampValidationData property generator Signed-off-by: Tiago Rossi --- .../DataGenTimeStampValidationData.java | 71 +++++++++++++++++++ .../DefaultProductionBindingsModule.java | 5 ++ 2 files changed, 76 insertions(+) create mode 100644 src/main/java/xades4j/production/DataGenTimeStampValidationData.java diff --git a/src/main/java/xades4j/production/DataGenTimeStampValidationData.java b/src/main/java/xades4j/production/DataGenTimeStampValidationData.java new file mode 100644 index 00000000..dbca80c9 --- /dev/null +++ b/src/main/java/xades4j/production/DataGenTimeStampValidationData.java @@ -0,0 +1,71 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.production; + +import java.security.cert.CRLException; +import java.security.cert.CertificateEncodingException; +import java.security.cert.X509CRL; +import java.security.cert.X509Certificate; + +import xades4j.properties.TimeStampValidationDataProperty; +import xades4j.properties.data.PropertyDataObject; +import xades4j.properties.data.TimeStampValidationDataData; + +/** + * + * @author Hubert Kario + * + */ +public class DataGenTimeStampValidationData implements + PropertyDataObjectGenerator +{ + + @Override + public PropertyDataObject generatePropertyData( + TimeStampValidationDataProperty prop, + PropertiesDataGenerationContext ctx) + throws PropertyDataGenerationException + { + TimeStampValidationDataData tsValidationDataData = + new TimeStampValidationDataData(); + + try + { + for (X509Certificate cer : prop.getCertificates()) + { + tsValidationDataData.addCertificateData(cer.getEncoded()); + } + } catch (CertificateEncodingException e) + { + throw new PropertyDataGenerationException(prop, "cannot get encoded certificate", e); + } + + try + { + for (X509CRL crl : prop.getCrls()) + { + tsValidationDataData.addCRLData(crl.getEncoded()); + } + } catch (CRLException e) + { + throw new PropertyDataGenerationException(prop, "cannot get encoded CRL", e); + } + + return tsValidationDataData; + } + +} diff --git a/src/main/java/xades4j/production/DefaultProductionBindingsModule.java b/src/main/java/xades4j/production/DefaultProductionBindingsModule.java index 1b42442b..c4d551b6 100644 --- a/src/main/java/xades4j/production/DefaultProductionBindingsModule.java +++ b/src/main/java/xades4j/production/DefaultProductionBindingsModule.java @@ -41,6 +41,7 @@ import xades4j.properties.SignerRoleProperty; import xades4j.properties.SigningCertificateProperty; import xades4j.properties.SigningTimeProperty; +import xades4j.properties.TimeStampValidationDataProperty; import xades4j.properties.data.CustomPropertiesDataObjsStructureVerifier; import xades4j.providers.AlgorithmsProvider; import xades4j.providers.AlgorithmsProviderEx; @@ -178,5 +179,9 @@ public void provideProperties(DataObjectDesc dataObj) bind(new TypeLiteral>() { }).to(DataGenArchiveTimeStamp.class); + + bind(new TypeLiteral>() + { + }).to(DataGenTimeStampValidationData.class); } } From 2e7f582bbebbe1baf75792ac1bafbc8ac1b21f27 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 22:47:40 +0100 Subject: [PATCH 43/84] allow for adding TimeStampValidationData add a fake transition from A form to A-VD form that will add TimeStampValidationData but won't change the form, as returned by XAdESFormChecker Signed-off-by: Tiago Rossi --- src/main/java/xades4j/utils/PropertiesUtils.java | 15 +++++++++++++++ src/main/java/xades4j/verification/XAdESForm.java | 3 ++- .../xades4j/verification/XAdESFormChecker.java | 4 +++- .../verification/XadesHybridVerifierImpl.java | 15 ++++++++++++++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/main/java/xades4j/utils/PropertiesUtils.java b/src/main/java/xades4j/utils/PropertiesUtils.java index a7a386b8..95da5aa0 100644 --- a/src/main/java/xades4j/utils/PropertiesUtils.java +++ b/src/main/java/xades4j/utils/PropertiesUtils.java @@ -32,6 +32,7 @@ import xades4j.properties.SignaturePolicyBase; import xades4j.properties.SignatureTimeStampProperty; import xades4j.properties.SignedSignatureProperty; +import xades4j.properties.TimeStampValidationDataProperty; import xades4j.properties.UnsignedSignatureProperty; import xades4j.providers.SignaturePolicyInfoProvider; import xades4j.providers.ValidationData; @@ -104,4 +105,18 @@ public static void addXadesAProperties( { usp.add(new ArchiveTimeStampProperty()); } + + public static void addXadesAVDProperties( + Collection usp, + Collection attributeValidationData) + { + Collection certificates = new ArrayList(); + Collection crls = new ArrayList(); + for (ValidationData valData : attributeValidationData) + { + certificates.addAll(valData.getCerts()); + crls.addAll(valData.getCrls()); + } + usp.add(new TimeStampValidationDataProperty(certificates, crls)); + } } diff --git a/src/main/java/xades4j/verification/XAdESForm.java b/src/main/java/xades4j/verification/XAdESForm.java index 46a07a8a..d8b01192 100644 --- a/src/main/java/xades4j/verification/XAdESForm.java +++ b/src/main/java/xades4j/verification/XAdESForm.java @@ -28,7 +28,8 @@ public enum XAdESForm C("C", "Electronic signature with complete validation data references"), X("X", "Extended signatures with time forms"), X_L("X-L", "Extended long electronic signatures with time"), - A("A", "Archival electronic signatures"); + A("A", "Archival electronic signatures"), + A_VD("A-VD", "Archival electronic signature with validation data"); /**/ private final String alias, fullName; diff --git a/src/main/java/xades4j/verification/XAdESFormChecker.java b/src/main/java/xades4j/verification/XAdESFormChecker.java index 2208d8e5..dcb025bd 100644 --- a/src/main/java/xades4j/verification/XAdESFormChecker.java +++ b/src/main/java/xades4j/verification/XAdESFormChecker.java @@ -28,6 +28,7 @@ import xades4j.properties.SignaturePolicyBase; import xades4j.properties.SignatureTimeStampProperty; import xades4j.properties.SigningCertificateProperty; +import xades4j.properties.TimeStampValidationDataProperty; /** * @@ -281,7 +282,8 @@ public XAdES_A_Desc() @Override protected boolean checkProps(Set availablePropsNames) throws InvalidXAdESFormException { - return availablePropsNames.contains(ArchiveTimeStampProperty.PROP_NAME); + return availablePropsNames.contains(ArchiveTimeStampProperty.PROP_NAME) || + availablePropsNames.contains(TimeStampValidationDataProperty.PROP_NAME); } @Override diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java index 2b2d79cb..9dcd645d 100644 --- a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -259,7 +259,7 @@ protected XAdESVerificationResult verify(Element signatureElem, // The transitions matrix won't allow this, but this way I avoid the // unnecessary processing. - if (finalForm.before(XAdESForm.T) || finalForm.after(XAdESForm.A)) + if (finalForm.before(XAdESForm.T) || finalForm.after(XAdESForm.A_VD)) { throw new IllegalArgumentException("Signature format can only be extended to XAdES-T or above"); } @@ -277,6 +277,7 @@ protected XAdESVerificationResult verify(Element signatureElem, // * C -> X-L // * X -> X-L // * X-L -> A + // * A -> A-VD FormExtensionPropsCollector finalFormPropsColector = formsExtensionTransitions[actualForm.ordinal()][finalForm.ordinal()]; @@ -407,6 +408,18 @@ public void addProps(Collection usp, } }; formsExtensionTransitions[XAdESForm.X_L.ordinal()][XAdESForm.A.ordinal()] = aPropsCol; + + // A -> A-VD + FormExtensionPropsCollector avdPropsCol = new FormExtensionPropsCollector() + { + @Override + public void addProps(Collection usp, + XAdESVerificationResult res) + { + PropertiesUtils.addXadesAVDProperties(usp, res.getAttributeValidationData()); + } + }; + formsExtensionTransitions[XAdESForm.A.ordinal()][XAdESForm.A_VD.ordinal()] = avdPropsCol; } public void setAcceptUnknownProperties(boolean acceptUnknownProperties) From 35b924cde3d0acb049ae85286121bfcdb2b936e2 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 17 Dec 2012 23:00:48 +0100 Subject: [PATCH 44/84] add test for creation and consumption of TimeStampValidationData Signed-off-by: Tiago Rossi --- .../verification/AgedTimeStampTest.java | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index 2b851fd5..cbfcd236 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -1212,7 +1212,7 @@ public void test03_X_sig3() throws Exception // extend X-L form to A form @Test - public void test03_X_sig4() throws Exception + public void test03_A_sig4() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1265,6 +1265,32 @@ public void test03_A_ver1() throws Exception assertEquals(XAdESForm.A, f); } + // add validation info to A form + @Test + public void test03_A_sig5() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + Document doc = getDocument("document.aged.test03_A_sig4.xml"); + Element signatureNode = getSigElement(doc); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test03_userCertValidationDataProviderXCreation, + test03_tsaCertValidationDataProviderAnow); + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + // extend A to A-VD + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A_VD); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test03_A_sig5.xml"); + } + // verify A form using minimal validators @Test public void test03_A_ver2() throws Exception @@ -1272,7 +1298,7 @@ public void test03_A_ver2() throws Exception System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); // verify using minimal data (just CA certificates) - XAdESForm f = verifySignature("document.aged.test03_A_sig4.xml", + XAdESForm f = verifySignature("document.aged.test03_A_sig5.xml", new XadesVerificationProfile(test03_userCertMinimalValidationDataProvider, test03_tsaCertMinimalValidationDataProvider)); From 66fe05e3eccd943ea7fa03232fd5b509967ffd41 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 00:14:38 +0100 Subject: [PATCH 45/84] add support for A form properties to ArchiveTimeStampVerifier Signed-off-by: Tiago Rossi --- .../verification/ArchiveTimeStampVerifier.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java index 5cb7598e..5750a2a7 100644 --- a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java @@ -36,6 +36,7 @@ import xades4j.properties.RevocationValuesProperty; import xades4j.properties.SigAndRefsTimeStampProperty; import xades4j.properties.SignatureTimeStampProperty; +import xades4j.properties.TimeStampValidationDataProperty; import xades4j.properties.data.ArchiveTimeStampData; import xades4j.providers.TimeStampVerificationProvider; import xades4j.utils.CannotAddDataToDigestInputException; @@ -218,8 +219,11 @@ protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( ArchiveTimeStampProperty.class)) { digestInput.addNode(elem); - } // else: ignore other properties - // TODO add TimeStampDataValidation property + } else if (isElementMatchingProperty(elem, + TimeStampValidationDataProperty.class)) + { + digestInput.addNode(elem); + }// else: ignore other properties } if (certificateValuesPresent && revocationValuesPresent) @@ -236,7 +240,14 @@ private boolean isElementMatchingProperty(Element elem, { try { - return elem.getLocalName().equalsIgnoreCase( + if (prop.equals(ArchiveTimeStampProperty.class) || + prop.equals(TimeStampValidationDataProperty.class)) + return elem.getLocalName().equalsIgnoreCase( + (String) prop.getField("PROP_NAME").get(null)) + && elem.getNamespaceURI().equalsIgnoreCase( + (String) prop.getField("XADESV141_XMLNS").get(null)); + else + return elem.getLocalName().equalsIgnoreCase( (String) prop.getField("PROP_NAME").get(null)) && elem.getNamespaceURI().equalsIgnoreCase( (String) prop.getField("XADES_XMLNS").get(null)); From 32bf4aadf17a6842a900e818bb6a0af78cf66e62 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 00:15:42 +0100 Subject: [PATCH 46/84] add simple test for TimeStampStampValidationData prop creation Signed-off-by: Tiago Rossi --- .../verification/XadesVerifierImplTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/test/java/xades4j/verification/XadesVerifierImplTest.java b/src/test/java/xades4j/verification/XadesVerifierImplTest.java index 7e27a8f1..344a6589 100644 --- a/src/test/java/xades4j/verification/XadesVerifierImplTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierImplTest.java @@ -33,6 +33,7 @@ import xades4j.properties.QualifyingProperty; import xades4j.properties.RevocationValuesProperty; import xades4j.properties.SigAndRefsTimeStampProperty; +import xades4j.properties.TimeStampValidationDataProperty; /** * @@ -282,6 +283,26 @@ public void testVerifyA() throws Exception assertEquals(XAdESForm.A, f); } + @Test + public void testVerifyAEnrichAVD() throws Exception + { + System.out.println("testVerifyXLEnrichA"); + + Document doc = getDocument("out/document.verified.c.xl.a.xml"); + Element signatureNode = getSigElement(doc); + + XadesSignatureFormatExtender formExt = + new XadesFormatExtenderProfile().getFormatExtender(); + XAdESVerificationResult res = nistVerificationProfile.newVerifier().verify( + signatureNode, null, formExt, XAdESForm.A_VD); + + assertEquals(XAdESForm.A, res.getSignatureForm()); + assertPropXAdES141ElementPresent(signatureNode, TimeStampValidationDataProperty.PROP_NAME); + + outputDocument(doc, "document.verified.c.xl.avd.xml"); + } + + private static void assertPropElementPresent( Element sigElem, String elemName) From 0b8d4c3fe219f2d6d364e611cba342cd62b14867 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 13:41:04 +0100 Subject: [PATCH 47/84] align ValidationDataType with version 1.4.2 of standard Signed-off-by: Tiago Rossi --- .../xml/bind/xades/XmlValidationDataType.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/xades4j/xml/bind/xades/XmlValidationDataType.java b/src/main/java/xades4j/xml/bind/xades/XmlValidationDataType.java index 401ae1f2..ab91bc54 100644 --- a/src/main/java/xades4j/xml/bind/xades/XmlValidationDataType.java +++ b/src/main/java/xades4j/xml/bind/xades/XmlValidationDataType.java @@ -33,7 +33,7 @@ * <element ref="{http://uri.etsi.org/01903/v1.3.2#}RevocationValues" minOccurs="0"/> * </sequence> * <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" /> - * <attribute name="UR" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> + * <attribute name="URI" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> * </restriction> * </complexContent> * </complexType> @@ -57,9 +57,9 @@ public class XmlValidationDataType { @XmlID @XmlSchemaType(name = "ID") protected String id; - @XmlAttribute(name = "UR") + @XmlAttribute(name = "URI") @XmlSchemaType(name = "anyURI") - protected String ur; + protected String uri; /** * Gets the value of the certificateValues property. @@ -134,27 +134,27 @@ public void setId(String value) { } /** - * Gets the value of the ur property. + * Gets the value of the uri property. * * @return * possible object is * {@link String } * */ - public String getUR() { - return ur; + public String getURI() { + return uri; } /** - * Sets the value of the ur property. + * Sets the value of the uri property. * * @param value * allowed object is * {@link String } * */ - public void setUR(String value) { - this.ur = value; + public void setURI(String value) { + this.uri = value; } } From a288b7040ccdbd2985edf8756c1ac06fa96ac030 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 00:16:20 +0100 Subject: [PATCH 48/84] update old unmarshaller Signed-off-by: Tiago Rossi --- .../xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java index ec87ebb4..ae7f34af 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlUnsupportedUSPLimiter.java @@ -34,8 +34,7 @@ public void convertFromObjectTree( xmlProps.getAttributeCertificateRefs(), xmlProps.getAttributeRevocationRefs(), xmlProps.getAttributeCertificateRefs()) || - !xmlProps.getRefsOnlyTimeStamp().isEmpty() || - !xmlProps.getArchiveTimeStamp().isEmpty()) + !xmlProps.getRefsOnlyTimeStamp().isEmpty()) throw new PropertyUnmarshalException("Unsupported properties were found", "Unsupported"); } } From 58163e7d9fbebd5bcf774694f38a9754d6e0902a Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 18:04:11 +0100 Subject: [PATCH 49/84] fix message in AgedTimeStampTest Signed-off-by: Tiago Rossi --- src/test/java/xades4j/verification/AgedTimeStampTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index cbfcd236..9ae42eaf 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -1221,7 +1221,7 @@ public void test03_A_sig4() throws Exception new Date(new Date().getTime() - ONE_HOUR_IN_MS * 10), new BigInteger("2")); - System.out.println("SigAndRefsTimeStamp creation date is " + System.out.println("ArchiveTimeStamp creation date is " + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 10)); Document doc = getDocument("document.aged.test03_X_sig3.xml"); From 6e3b65e739aea803b1027bbc118175fa8588a867 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 18:13:41 +0100 Subject: [PATCH 50/84] add test for A-TimeStamping already A-TimeStamped document Signed-off-by: Tiago Rossi --- .../verification/AgedTimeStampTest.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index 9ae42eaf..afa0b7ba 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -1305,6 +1305,41 @@ public void test03_A_ver2() throws Exception assertEquals(XAdESForm.A, f); } + // time stamp A(VD) form again + @Test + public void test03_A_sig6() throws Exception + { + System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + + SurrogateTimeStampTokenProvider.setTSACert(test03_A_tsa3Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTimeAndSerial( + new Date(), + new BigInteger("3")); + + System.out.println("ArchiveTimeStamp creation date is " + + new Date()); + + Document doc = getDocument("document.aged.test03_A_sig5.xml"); + Element signatureNode = getSigElement(doc); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test03_userCertValidationDataProviderXCreation, + test03_tsaCertValidationDataProviderAnow); + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + // extend A to A (add ArchiveTimeStamp) + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test03_A_sig6.xml"); + + } + /* * TODO missing grace period support * The library should support enforcing grace period, but what's more important, it From 289c4d445ed625e79ae5df50b5a4316512bd0244 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 18:14:19 +0100 Subject: [PATCH 51/84] add support for A-timeStamping already A-timeStamped document Signed-off-by: Tiago Rossi --- .../xades4j/verification/XadesHybridVerifierImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java index 9dcd645d..5d64e833 100644 --- a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -267,7 +267,7 @@ protected XAdESVerificationResult verify(Element signatureElem, XAdESVerificationResult res = this.verify(signatureElem, verificationOptions, now); XAdESForm actualForm = res.getSignatureForm(); - if (actualForm.before(finalForm)) + if (!finalForm.before(actualForm)) { // Valid form transitions: // * BES/EPES -> T @@ -277,7 +277,9 @@ protected XAdESVerificationResult verify(Element signatureElem, // * C -> X-L // * X -> X-L // * X-L -> A - // * A -> A-VD + // * A -> A + // * A -> A-VD (A-VD is not a real form, it's used to tell library to create + // TimesStampValidationData element) FormExtensionPropsCollector finalFormPropsColector = formsExtensionTransitions[actualForm.ordinal()][finalForm.ordinal()]; @@ -408,6 +410,8 @@ public void addProps(Collection usp, } }; formsExtensionTransitions[XAdESForm.X_L.ordinal()][XAdESForm.A.ordinal()] = aPropsCol; + // A -> A + formsExtensionTransitions[XAdESForm.A.ordinal()][XAdESForm.A.ordinal()] = aPropsCol; // A -> A-VD FormExtensionPropsCollector avdPropsCol = new FormExtensionPropsCollector() From 58f93d61d0f1da42d5f3e67fc1ad7fdd64b86d5f Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 16 Dec 2012 21:20:53 +0100 Subject: [PATCH 52/84] don't require optional properties in ArchiveTimeStamp For ArchiveTimeStamp only CertificateValues and RevocationValues MUST be present Signed-off-by: Tiago Rossi --- .../xades4j/production/DataGenArchiveTimeStamp.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/xades4j/production/DataGenArchiveTimeStamp.java b/src/main/java/xades4j/production/DataGenArchiveTimeStamp.java index 61a37923..23102e36 100644 --- a/src/main/java/xades4j/production/DataGenArchiveTimeStamp.java +++ b/src/main/java/xades4j/production/DataGenArchiveTimeStamp.java @@ -28,11 +28,8 @@ import org.w3c.dom.Element; import xades4j.properties.ArchiveTimeStampProperty; import xades4j.properties.CertificateValuesProperty; -import xades4j.properties.CompleteCertificateRefsProperty; -import xades4j.properties.CompleteRevocationRefsProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.RevocationValuesProperty; -import xades4j.properties.SignatureTimeStampProperty; import xades4j.properties.data.ArchiveTimeStampData; import xades4j.properties.data.BaseXAdESTimeStampData; import xades4j.providers.AlgorithmsProviderEx; @@ -94,13 +91,10 @@ protected void addPropSpecificTimeStampInput( if (ki != null) digestInput.addNode(ki.getElement()); - // Unsigned properties, in order of appearance. - Map propsCnt = new HashMap(5); + // Required properties, in order of appearance. + Map propsCnt = new HashMap(2); propsCnt.put(CertificateValuesProperty.PROP_NAME, 0); propsCnt.put(RevocationValuesProperty.PROP_NAME, 0); - propsCnt.put(CompleteCertificateRefsProperty.PROP_NAME, 0); - propsCnt.put(CompleteRevocationRefsProperty.PROP_NAME, 0); - propsCnt.put(SignatureTimeStampProperty.PROP_NAME, 0); e = DOMHelper.getFirstChildElement(unsignedSigPropsElem); // UnsignedProperties shouldn't be empty! From 6807b7e2254516eb42f3d50153d43de56d8c2261 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 18 Dec 2012 18:38:57 +0100 Subject: [PATCH 53/84] add support for creating multiple timeStamps of T and X type while we can verify documents with multiple timeStamps (because the verificator uses soft-fail approach) we weren't able to create multiple T- or X-form timestamps by extending signature Signed-off-by: Tiago Rossi --- .../java/xades4j/verification/XadesHybridVerifierImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java index 5d64e833..e1d16b40 100644 --- a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -272,9 +272,11 @@ protected XAdESVerificationResult verify(Element signatureElem, // Valid form transitions: // * BES/EPES -> T // * BES/EPES -> C + // * T -> T // * T -> C // * C -> X // * C -> X-L + // * X -> X // * X -> X-L // * X-L -> A // * A -> A @@ -323,6 +325,8 @@ public void addProps( }; formsExtensionTransitions[XAdESForm.BES.ordinal()][XAdESForm.T.ordinal()] = tPropsCol; formsExtensionTransitions[XAdESForm.EPES.ordinal()][XAdESForm.T.ordinal()] = tPropsCol; + // T -> T + formsExtensionTransitions[XAdESForm.T.ordinal()][XAdESForm.T.ordinal()] = tPropsCol; // BES/EPES -> C FormExtensionPropsCollector cAndTPropsCol = new FormExtensionPropsCollector() @@ -367,6 +371,8 @@ public void addProps( } }; formsExtensionTransitions[XAdESForm.C.ordinal()][XAdESForm.X.ordinal()] = xPropsCol; + // X -> X + formsExtensionTransitions[XAdESForm.X.ordinal()][XAdESForm.X.ordinal()] = xPropsCol; // C -> X-L FormExtensionPropsCollector xlAndXPropsCol = new FormExtensionPropsCollector() From c6ddb9f67fdc50f746ce9e97f61d78f80dd5acf6 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Wed, 19 Dec 2012 19:24:07 +0100 Subject: [PATCH 54/84] save validation data with time stamp property To ease the life of library users, return validation data used to verify time stamp properties in the property object itself. As a small bonus, gets rid of method invocation by reflection in TimeStampVerifierBase. Signed-off-by: Tiago Rossi --- .../AllDataObjsTimeStampProperty.java | 16 ++++++ .../properties/ArchiveTimeStampProperty.java | 18 ++++++ .../BaseXAdESTimeStampProperty.java | 55 +++++++++++++++++++ .../IndividualDataObjsTimeStampProperty.java | 16 ++++++ .../SigAndRefsTimeStampProperty.java | 16 ++++++ .../SignatureTimeStampProperty.java | 23 ++++++-- .../providers/TimeStampVerificationData.java | 55 +++++++++++++++++++ .../TimeStampVerificationProvider.java | 4 +- .../DefaultTimeStampVerificationProvider.java | 6 +- .../AllDataObjsTimeStampVerifier.java | 3 +- .../ArchiveTimeStampVerifier.java | 3 +- .../IndivDataObjsTimeStampVerifier.java | 3 +- .../SigAndRefsTimeStampVerifier.java | 3 +- .../SignatureTimeStampVerifier.java | 3 +- .../verification/TimeStampVerifierBase.java | 18 +++--- 15 files changed, 217 insertions(+), 25 deletions(-) create mode 100644 src/main/java/xades4j/properties/BaseXAdESTimeStampProperty.java create mode 100644 src/main/java/xades4j/providers/TimeStampVerificationData.java diff --git a/src/main/java/xades4j/properties/AllDataObjsTimeStampProperty.java b/src/main/java/xades4j/properties/AllDataObjsTimeStampProperty.java index b9af316a..efaa69d2 100644 --- a/src/main/java/xades4j/properties/AllDataObjsTimeStampProperty.java +++ b/src/main/java/xades4j/properties/AllDataObjsTimeStampProperty.java @@ -18,6 +18,8 @@ import java.util.Date; +import xades4j.providers.ValidationData; + /** * Represents a time-stamp computed before the signature production, over the sequence * formed by ALL the {@code ds:Reference} elements within the {@code ds:SignedInfo} @@ -31,9 +33,11 @@ * @author Luís */ public final class AllDataObjsTimeStampProperty extends SignedDataObjectProperty + implements BaseXAdESTimeStampProperty { public static final String PROP_NAME = "AllDataObjectsTimeStamp"; private Date time; + private ValidationData validationData; public AllDataObjsTimeStampProperty() { @@ -64,4 +68,16 @@ public void setTime(Date time) { this.time = time; } + + @Override + public ValidationData getValidationData() + { + return validationData; + } + + @Override + public void setValidationData(ValidationData validationData) + { + this.validationData = validationData; + } } diff --git a/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java b/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java index 645b6127..cfb0835b 100644 --- a/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java +++ b/src/main/java/xades4j/properties/ArchiveTimeStampProperty.java @@ -18,22 +18,27 @@ import java.util.Date; +import xades4j.providers.ValidationData; + /** * The {@code xades141:ArchiveTimeStamp} unsigned signature property. Used for the * XAdES-A form. * @author Luís */ public final class ArchiveTimeStampProperty extends UnsignedSignatureProperty + implements BaseXAdESTimeStampProperty { // it's in "xades141" namespace though! public static final String PROP_NAME = "ArchiveTimeStamp"; /**/ private Date time; + private ValidationData validationData; /** * Gets the time-stamp time after signature production or verification. * @return the time or {@code null} if the property wasn't part of a signature production */ + @Override public Date getTime() { return time; @@ -44,6 +49,7 @@ public Date getTime() * the time-stamp can be accessed afterwards. * @param time the time */ + @Override public void setTime(Date time) { this.time = time; @@ -54,4 +60,16 @@ public String getName() { return PROP_NAME; } + + @Override + public ValidationData getValidationData() + { + return validationData; + } + + @Override + public void setValidationData(ValidationData validationData) + { + this.validationData = validationData; + } } diff --git a/src/main/java/xades4j/properties/BaseXAdESTimeStampProperty.java b/src/main/java/xades4j/properties/BaseXAdESTimeStampProperty.java new file mode 100644 index 00000000..d5ad262a --- /dev/null +++ b/src/main/java/xades4j/properties/BaseXAdESTimeStampProperty.java @@ -0,0 +1,55 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.properties; + +import java.util.Date; + +import xades4j.providers.ValidationData; + +/** + * Interface applicable to all TimeStampProperties used in XAdES signatures. + * Provides the ability to query for time from time stamp token and validation data + * used to verify the token. + * + * @author Hubert Kario + * + */ +public interface BaseXAdESTimeStampProperty extends QualifyingProperty +{ + /** + * Return the time at which the token claims to be generated. + *

+ * Note: if there are multiple time stamp tokens in single property, only the time + * from last one will be returned. + * @return time from time stamp token in the property + */ + public Date getTime(); + + public void setTime(Date time); + + /** + * Validation data (certificates and CRLs) used to check validity of the time stamp + * token + *

+ * Note: if there are multiple time stamp tokens in property, only validation data + * for the last one will be returned. + * @return validation data + */ + public ValidationData getValidationData(); + + public void setValidationData(ValidationData validationData); +} diff --git a/src/main/java/xades4j/properties/IndividualDataObjsTimeStampProperty.java b/src/main/java/xades4j/properties/IndividualDataObjsTimeStampProperty.java index bfb77522..6c39ce7b 100644 --- a/src/main/java/xades4j/properties/IndividualDataObjsTimeStampProperty.java +++ b/src/main/java/xades4j/properties/IndividualDataObjsTimeStampProperty.java @@ -18,6 +18,8 @@ import java.util.Date; +import xades4j.providers.ValidationData; + /** * Represents a time-stamp computed before the signature production, over a sequence * formed by some of the {@code ds:Reference} elements within the {@code ds:SignedInfo} @@ -31,10 +33,12 @@ * @author Luís */ public final class IndividualDataObjsTimeStampProperty extends SignedDataObjectProperty + implements BaseXAdESTimeStampProperty { public static final String PROP_NAME = "IndividualDataObjectsTimeStamp"; /**/ private Date time; + private ValidationData validationData; public IndividualDataObjsTimeStampProperty() { @@ -65,4 +69,16 @@ public void setTime(Date time) { this.time = time; } + + @Override + public ValidationData getValidationData() + { + return validationData; + } + + @Override + public void setValidationData(ValidationData validationData) + { + this.validationData = validationData; + } } diff --git a/src/main/java/xades4j/properties/SigAndRefsTimeStampProperty.java b/src/main/java/xades4j/properties/SigAndRefsTimeStampProperty.java index df397275..488bab0d 100644 --- a/src/main/java/xades4j/properties/SigAndRefsTimeStampProperty.java +++ b/src/main/java/xades4j/properties/SigAndRefsTimeStampProperty.java @@ -18,6 +18,8 @@ import java.util.Date; +import xades4j.providers.ValidationData; + /** * The {@code SigAndRefsTimeStamp} element is an unsigned property qualifying * the signature. @@ -29,10 +31,12 @@ * @author Luís */ public final class SigAndRefsTimeStampProperty extends UnsignedSignatureProperty + implements BaseXAdESTimeStampProperty { public static final String PROP_NAME = "SigAndRefsTimeStamp"; /**/ private Date time; + private ValidationData validationData; /** * Gets the time-stamp time. @@ -53,4 +57,16 @@ public String getName() { return PROP_NAME; } + + @Override + public ValidationData getValidationData() + { + return validationData; + } + + @Override + public void setValidationData(ValidationData validationData) + { + this.validationData = validationData; + } } diff --git a/src/main/java/xades4j/properties/SignatureTimeStampProperty.java b/src/main/java/xades4j/properties/SignatureTimeStampProperty.java index ca01d980..d8719e0a 100644 --- a/src/main/java/xades4j/properties/SignatureTimeStampProperty.java +++ b/src/main/java/xades4j/properties/SignatureTimeStampProperty.java @@ -18,16 +18,19 @@ import java.util.Date; +import xades4j.providers.ValidationData; + /** * The {@code SignatureTimeStamp} property encapsulates the time-stamp over the * {@code ds:SignatureValue} element. * @author Luís */ public final class SignatureTimeStampProperty extends UnsignedSignatureProperty + implements BaseXAdESTimeStampProperty { public static final String PROP_NAME = "SignatureTimeStamp"; - /**/ private Date time; + private ValidationData validationData; public SignatureTimeStampProperty() { @@ -39,17 +42,27 @@ public String getName() return PROP_NAME; } - /** - * Gets the time-stamp time. - * @return the time or {@code null} if the property hasn't been processed in signature production or verification. - */ + @Override public Date getTime() { return time; } + @Override public void setTime(Date time) { this.time = time; } + + @Override + public ValidationData getValidationData() + { + return validationData; + } + + @Override + public void setValidationData(ValidationData validationData) + { + this.validationData = validationData; + } } diff --git a/src/main/java/xades4j/providers/TimeStampVerificationData.java b/src/main/java/xades4j/providers/TimeStampVerificationData.java new file mode 100644 index 00000000..b829794a --- /dev/null +++ b/src/main/java/xades4j/providers/TimeStampVerificationData.java @@ -0,0 +1,55 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.providers; + +import java.util.Date; + +/** + * Container for validation data and verification result of a time stamp. + *

+ * Contains both all certificate and CRLs used for verification of time stamp (in + * {@code ValidationData} object), as well as the time inside the token. + * + * @author Hubert Kario + * + */ +public class TimeStampVerificationData +{ + private final ValidationData validationData; + private final Date timeStampDate; + + public TimeStampVerificationData( + ValidationData validationData, + Date timeFromTimeStampToken) + { + if (validationData == null || timeFromTimeStampToken == null) + throw new NullPointerException("Neither ValidationData nor " + + "timeFromTimeStampToken parameters can be null"); + this.validationData = validationData; + this.timeStampDate = timeFromTimeStampToken; + } + + public ValidationData getValidationData() + { + return validationData; + } + + public Date getTimeStampTokenTime() + { + return timeStampDate; + } +} diff --git a/src/main/java/xades4j/providers/TimeStampVerificationProvider.java b/src/main/java/xades4j/providers/TimeStampVerificationProvider.java index d74c8f1c..9ddfe803 100644 --- a/src/main/java/xades4j/providers/TimeStampVerificationProvider.java +++ b/src/main/java/xades4j/providers/TimeStampVerificationProvider.java @@ -16,8 +16,6 @@ */ package xades4j.providers; -import java.util.Date; - import xades4j.verification.QualifyingPropertyVerificationContext; /** @@ -35,7 +33,7 @@ public interface TimeStampVerificationProvider * @return the time-stamp * @throws TimeStampTokenVerificationException if the token cannot be validated (see subclasses of the exception) */ - public Date verifyToken( + public TimeStampVerificationData verifyToken( byte[] timeStampToken, byte[] tsDigestInput, QualifyingPropertyVerificationContext ctx) diff --git a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java index 4fb0f273..35bf9463 100644 --- a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java +++ b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java @@ -24,7 +24,6 @@ import java.security.cert.X509Certificate; import java.util.Arrays; import java.util.Collections; -import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -50,6 +49,7 @@ import xades4j.providers.TimeStampTokenStructureException; import xades4j.providers.TimeStampTokenTSACertException; import xades4j.providers.TimeStampTokenVerificationException; +import xades4j.providers.TimeStampVerificationData; import xades4j.providers.TimeStampVerificationProvider; import xades4j.providers.ValidationData; import xades4j.verification.QualifyingPropertyVerificationContext; @@ -103,7 +103,7 @@ public DefaultTimeStampVerificationProvider( } @Override - public Date verifyToken(byte[] timeStampToken, byte[] tsDigestInput, + public TimeStampVerificationData verifyToken(byte[] timeStampToken, byte[] tsDigestInput, QualifyingPropertyVerificationContext ctx) throws TimeStampTokenVerificationException { @@ -193,6 +193,6 @@ public Date verifyToken(byte[] timeStampToken, byte[] tsDigestInput, if (ctx != null) ctx.addAttributeValidationData(vData); - return tsTokenInfo.getGenTime(); + return new TimeStampVerificationData(vData, tsTokenInfo.getGenTime()); } } diff --git a/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java b/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java index aecd0602..582bd24d 100644 --- a/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/AllDataObjsTimeStampVerifier.java @@ -22,6 +22,7 @@ import org.w3c.dom.Element; import xades4j.properties.AllDataObjsTimeStampProperty; +import xades4j.properties.BaseXAdESTimeStampProperty; import xades4j.utils.CannotAddDataToDigestInputException; import xades4j.properties.QualifyingProperty; import xades4j.utils.TimeStampDigestInput; @@ -45,7 +46,7 @@ public AllDataObjsTimeStampVerifier( } @Override - protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + protected BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreateProperty( AllDataObjsTimeStampData propData, Element location, TimeStampDigestInput digestInput, diff --git a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java index 5750a2a7..a4341c00 100644 --- a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java @@ -28,6 +28,7 @@ import xades4j.properties.ArchiveTimeStampProperty; import xades4j.properties.AttrAuthoritiesCertValuesProperty; import xades4j.properties.AttributeRevocationValuesProperty; +import xades4j.properties.BaseXAdESTimeStampProperty; import xades4j.properties.CertificateValuesProperty; import xades4j.properties.CompleteCertificateRefsProperty; import xades4j.properties.CompleteRevocationRefsProperty; @@ -58,7 +59,7 @@ public ArchiveTimeStampVerifier( } @Override - protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + protected BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreateProperty( ArchiveTimeStampData propData, Element location, TimeStampDigestInput digestInput, QualifyingPropertyVerificationContext ctx) diff --git a/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java b/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java index c1aecf5c..87bfaa5c 100644 --- a/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/IndivDataObjsTimeStampVerifier.java @@ -20,6 +20,7 @@ import com.google.inject.Inject; import xades4j.utils.CannotAddDataToDigestInputException; +import xades4j.properties.BaseXAdESTimeStampProperty; import xades4j.properties.IndividualDataObjsTimeStampProperty; import xades4j.properties.QualifyingProperty; import xades4j.utils.TimeStampDigestInput; @@ -43,7 +44,7 @@ public IndivDataObjsTimeStampVerifier( } @Override - protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + protected BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreateProperty( IndividualDataObjsTimeStampData propData, Element location, TimeStampDigestInput digestInput, diff --git a/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java b/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java index acacc2c7..886846b7 100644 --- a/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/SigAndRefsTimeStampVerifier.java @@ -22,6 +22,7 @@ import com.google.inject.Inject; +import xades4j.properties.BaseXAdESTimeStampProperty; import xades4j.properties.CompleteCertificateRefsProperty; import xades4j.properties.CompleteRevocationRefsProperty; import xades4j.properties.QualifyingProperty; @@ -53,7 +54,7 @@ public SigAndRefsTimeStampVerifier( } @Override - protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + protected BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreateProperty( SigAndRefsTimeStampData propData, Element location, TimeStampDigestInput digestInput, QualifyingPropertyVerificationContext ctx) diff --git a/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java b/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java index 8a1cfb45..1655973e 100644 --- a/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/SignatureTimeStampVerifier.java @@ -20,6 +20,7 @@ import org.apache.xml.security.utils.Constants; import org.w3c.dom.Element; import xades4j.utils.CannotAddDataToDigestInputException; +import xades4j.properties.BaseXAdESTimeStampProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.SignatureTimeStampProperty; import xades4j.utils.TimeStampDigestInput; @@ -43,7 +44,7 @@ public SignatureTimeStampVerifier( } @Override - protected QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + protected BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreateProperty( SignatureTimeStampData propData, Element location, TimeStampDigestInput digestInput, diff --git a/src/main/java/xades4j/verification/TimeStampVerifierBase.java b/src/main/java/xades4j/verification/TimeStampVerifierBase.java index 00db62af..66953bb4 100644 --- a/src/main/java/xades4j/verification/TimeStampVerifierBase.java +++ b/src/main/java/xades4j/verification/TimeStampVerifierBase.java @@ -16,19 +16,19 @@ */ package xades4j.verification; -import java.lang.reflect.Method; -import java.util.Date; import java.util.List; import org.w3c.dom.Element; import xades4j.UnsupportedAlgorithmException; +import xades4j.properties.BaseXAdESTimeStampProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.BaseXAdESTimeStampData; import xades4j.providers.TimeStampTokenDigestException; import xades4j.providers.TimeStampTokenSignatureException; import xades4j.providers.TimeStampTokenStructureException; import xades4j.providers.TimeStampTokenVerificationException; +import xades4j.providers.TimeStampVerificationData; import xades4j.providers.TimeStampVerificationProvider; import xades4j.utils.CannotAddDataToDigestInputException; import xades4j.utils.TimeStampDigestInput; @@ -62,7 +62,7 @@ public final QualifyingProperty verify( { TimeStampDigestInput digestInput = this.tsInputFactory.newTimeStampDigestInput(propData.getCanonicalizationAlgorithm()); - QualifyingProperty prop = addPropSpecificTimeStampInputAndCreateProperty( + BaseXAdESTimeStampProperty prop = addPropSpecificTimeStampInputAndCreateProperty( propData, elem, digestInput, @@ -73,15 +73,15 @@ public final QualifyingProperty verify( * the tokens are verified, but the returned time-stamp is from the last token. */ List tokens = propData.getTimeStampTokens(); - Date ts = null; + TimeStampVerificationData tsVerData = null; for (byte[] tkn : tokens) { - ts = this.tsVerifier.verifyToken(tkn, data, ctx); + tsVerData = this.tsVerifier.verifyToken(tkn, data, ctx); } - // By convention all timestamp property types have a setTime(Date) method - Method setTimeMethod = prop.getClass().getMethod("setTime", Date.class); - setTimeMethod.invoke(prop, ts); + prop.setTime(tsVerData.getTimeStampTokenTime()); + prop.setValidationData(tsVerData.getValidationData()); + // should be a noop, only ArchiveTimeStamp should use it to change the // verification time for all subsequent TimeStamps updateContextAfterVerification(prop,ctx); @@ -114,7 +114,7 @@ public final QualifyingProperty verify( return verify(propData, null, ctx); } - protected abstract QualifyingProperty addPropSpecificTimeStampInputAndCreateProperty( + protected abstract BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreateProperty( TData propData, Element location, TimeStampDigestInput digestInput, From 63ce05263c1eb065bdc12ba6b8c2177287ecced6 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Wed, 19 Dec 2012 20:20:37 +0100 Subject: [PATCH 55/84] clean up SurrogateTimeStampTokenProvider Signed-off-by: Tiago Rossi --- .../xades4j/verification/AgedTimeStampTest.java | 17 +++++++---------- .../SurrogateTimeStampTokenProvider.java | 8 +------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index afa0b7ba..bbb7ad7c 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -54,8 +54,6 @@ import org.apache.xml.security.utils.Constants; import org.bouncycastle.asn1.x509.CRLReason; -import org.bouncycastle.bcpg.sig.RevocationReason; -import org.bouncycastle.bcpg.sig.RevocationReasonTags; import org.bouncycastle.cert.jcajce.JcaCertStore; import org.bouncycastle.util.Store; import org.junit.Test; @@ -776,7 +774,7 @@ public void test01_T_sig1() throws Exception System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); // test signing - SurrogateTimeStampTokenProvider.setTSACert(test01_T_tsaCert, test01_T_userCaStore); + SurrogateTimeStampTokenProvider.setTSACert(test01_T_tsaCert); SurrogateTimeStampTokenProvider.setTimeAndSerial( new Date(new Date().getTime() - ONE_HOUR_IN_MS/2), new BigInteger("3")); @@ -970,7 +968,7 @@ public void test02_X_sig1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); - SurrogateTimeStampTokenProvider.setTSACert(test02_X_tsa1Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTSACert(test02_X_tsa1Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20), new BigInteger("1")); @@ -992,7 +990,7 @@ public void test02_X_sig2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); - SurrogateTimeStampTokenProvider.setTSACert(test02_X_tsa2Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTSACert(test02_X_tsa2Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14), new BigInteger("2")); @@ -1122,7 +1120,7 @@ public void test03_T_sig1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); - SurrogateTimeStampTokenProvider.setTSACert(test03_T_tsa1Cert, test03_userCaStore); + SurrogateTimeStampTokenProvider.setTSACert(test03_T_tsa1Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20), new BigInteger("1")); @@ -1144,7 +1142,7 @@ public void test03_X_sig2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); - SurrogateTimeStampTokenProvider.setTSACert(test03_X_tsa2Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTSACert(test03_X_tsa2Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14), new BigInteger("2")); @@ -1216,7 +1214,7 @@ public void test03_A_sig4() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); - SurrogateTimeStampTokenProvider.setTSACert(test03_A_tsa3Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTSACert(test03_A_tsa3Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( new Date(new Date().getTime() - ONE_HOUR_IN_MS * 10), new BigInteger("2")); @@ -1311,7 +1309,7 @@ public void test03_A_sig6() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); - SurrogateTimeStampTokenProvider.setTSACert(test03_A_tsa3Cert, test02_X_userCaStore); + SurrogateTimeStampTokenProvider.setTSACert(test03_A_tsa3Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( new Date(), new BigInteger("3")); @@ -1337,7 +1335,6 @@ public void test03_A_sig6() throws Exception assertEquals(res.getSignatureForm(), XAdESForm.A); outputDocument(doc, "document.aged.test03_A_sig6.xml"); - } /* diff --git a/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java b/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java index c23240de..c90c4cf5 100644 --- a/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java +++ b/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java @@ -38,10 +38,7 @@ import org.bouncycastle.asn1.x509.AlgorithmIdentifier; import org.bouncycastle.cms.DefaultSignedAttributeTableGenerator; import org.bouncycastle.cms.SignerInfoGenerator; -import org.bouncycastle.cms.SignerInformationVerifier; import org.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilder; -import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoGeneratorBuilder; -import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder; import org.bouncycastle.operator.DigestCalculator; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder; @@ -52,7 +49,6 @@ import org.bouncycastle.tsp.TimeStampResponseGenerator; import org.bouncycastle.tsp.TimeStampToken; import org.bouncycastle.tsp.TimeStampTokenGenerator; -import org.bouncycastle.util.Store; import com.google.inject.Inject; @@ -71,7 +67,6 @@ class SurrogateTimeStampTokenProvider implements TimeStampTokenProvider { private static FullCert tsaCert; private static String algorithm = "SHA1withRSA"; - private static Store caCerts; private static Date now = null; private static BigInteger serial; @@ -98,10 +93,9 @@ public static void setSigAlgorithm(String alg) algorithm = alg; } - public static void setTSACert(FullCert cert, Store caCerts) + public static void setTSACert(FullCert cert) { tsaCert = cert; - SurrogateTimeStampTokenProvider.caCerts = caCerts; } public static void setTimeAndSerial(Date time, BigInteger serial) From 4284c92fb3aa5840050243d428f8fab6441b0de5 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Wed, 19 Dec 2012 20:21:33 +0100 Subject: [PATCH 56/84] update JavaDocs to reflect support for XAdES-A Signed-off-by: Tiago Rossi --- .../production/XadesCSigningProfile.java | 18 ++++ .../XadesFormatExtenderProfile.java | 2 +- .../production/XadesSigningProfile.java | 16 ++-- .../production/XadesTSigningProfile.java | 9 +- .../xades4j/providers/ValidationData.java | 3 +- .../ArchiveTimeStampVerifier.java | 2 +- ...ybridQualifyingPropertiesVerifierImpl.java | 11 ++- .../SignatureSpecificVerificationOptions.java | 3 +- .../verification/XAdESVerificationResult.java | 24 ++++- .../XadesVerificationProfile.java | 8 +- .../xades4j/verification/XadesVerifier.java | 93 +++++++++++++++---- .../SurrogateTimeStampTokenProvider.java | 3 +- 12 files changed, 153 insertions(+), 39 deletions(-) diff --git a/src/main/java/xades4j/production/XadesCSigningProfile.java b/src/main/java/xades4j/production/XadesCSigningProfile.java index d522a024..5db0a88f 100644 --- a/src/main/java/xades4j/production/XadesCSigningProfile.java +++ b/src/main/java/xades4j/production/XadesCSigningProfile.java @@ -28,10 +28,19 @@ *

* The {@code AttributeCertificateRefs} and {@code AttributeRevocationRefs} properties * are not supported. + *

+ * If the (implicit or explicit) policy you're following requires grace periods for + * signature creation, it is highly recommended not to use this signing profile + * but to use {@link XadesTSigningProfile} for initial signature creation and then extend + * the signature to XAdES-C form after the grace period has elapsed and new revocation + * information is available. * @author Luís */ public class XadesCSigningProfile extends XadesTSigningProfile { + /** + * @see XadesCSigningProfile + */ public XadesCSigningProfile( KeyingDataProvider keyingProvider, ValidationDataProvider validationDataProv) @@ -40,6 +49,9 @@ public XadesCSigningProfile( withBinding(ValidationDataProvider.class, validationDataProv); } + /** + * @see XadesCSigningProfile + */ public XadesCSigningProfile( KeyingDataProvider keyingProvider, Class validationDataProvClass) @@ -48,6 +60,9 @@ public XadesCSigningProfile( withBinding(ValidationDataProvider.class, validationDataProvClass); } + /** + * @see XadesCSigningProfile + */ public XadesCSigningProfile( Class keyingProviderClass, ValidationDataProvider validationDataProv) @@ -56,6 +71,9 @@ public XadesCSigningProfile( withBinding(ValidationDataProvider.class, validationDataProv); } + /** + * @see XadesCSigningProfile + */ public XadesCSigningProfile( Class keyingProviderClass, Class validationDataProvClass) diff --git a/src/main/java/xades4j/production/XadesFormatExtenderProfile.java b/src/main/java/xades4j/production/XadesFormatExtenderProfile.java index 52a46c54..8c05a372 100644 --- a/src/main/java/xades4j/production/XadesFormatExtenderProfile.java +++ b/src/main/java/xades4j/production/XadesFormatExtenderProfile.java @@ -34,7 +34,7 @@ * is used to add unsigned signature properties to an existing signature in order * augment its format. This can be done as part of the {@link xades4j.verification.XadesVerifier#verify(org.w3c.dom.Element, xades4j.verification.SignatureSpecificVerificationOptions, xades4j.production.XadesSignatureFormatExtender, xades4j.verification.XAdESForm) verification process}. * The {@code XadesSignatureFormatExtender} can also be used separately, but no - * checks are made on the correctness of the signature. + * checks are made on the correctness of the signature or added properties. *

* This profile follows the same principles of {@link XadesSigningProfile}. * @author Luís diff --git a/src/main/java/xades4j/production/XadesSigningProfile.java b/src/main/java/xades4j/production/XadesSigningProfile.java index 652eb7d0..6e10b13d 100644 --- a/src/main/java/xades4j/production/XadesSigningProfile.java +++ b/src/main/java/xades4j/production/XadesSigningProfile.java @@ -44,7 +44,9 @@ * The purpose of this class is to configure a {@link XadesSigner} that will actually * produce signatures with those characteristics. *

- * Only a {@link KeyingDataProvider} has to externally be supplied. All the other components + * Only a {@link KeyingDataProvider} has to externally be supplied. If you're creating + * a XAdES-T or XAdES-C form, it's highly recommended to change the default + * {@link TimeStampTokenProvider}. All the other components * have default implementations that are used if no other actions are taken. However, * all of them can be replaced through the corresponding methods, either by an instance * or a class. When a class is used it may have dependencies on other components, @@ -58,12 +60,14 @@ *

* The XAdES form is also part of the profile. Each form has additional requirements, * hence being defined by a specific subclass. There are profiles up to XAdES-C. - * The extended formats are also supported (with a few limitations) but can only - * be added after verfication ({@link xades4j.verification.XadesVerifier}). + * If the policy you're implementing requires grace periods for signatures, it's highly + * recommended to not create XAdES-C form directly. + * The extended formats are also supported but can only + * be added after verification ({@link xades4j.verification.XadesVerifier}). *

* Repeated dependency bindings will not cause an immediate error. An exception * will be thrown when an instance of {@code XadesSigner} is requested. - * + * * @see XadesBesSigningProfile * @see XadesEpesSigningProfile * @see XadesTSigningProfile @@ -103,7 +107,7 @@ protected XadesSigningProfile( /** * Creates a new {@code XadesSigner} based on the current state of the profile. * If any changes are made after this call, the previously returned signer will - * not be afected. Other signers can be created, accumulating the profile changes. + * not be affected. Other signers can be created, accumulating the profile changes. * @return a {@code XadesSigner} accordingly to this profile * @throws XadesProfileResolutionException if the dependencies of the signer (direct and indirect) cannot be resolved */ @@ -116,7 +120,7 @@ public final XadesSigner newSigner() throws XadesProfileResolutionException /***/ /** - * Adds a type dependency mapping to the profile. This is tipically done from an + * Adds a type dependency mapping to the profile. This is typically done from an * interface to a type that implements that interface. When a dependency to * {@code from} is found, the {@code to} class is used. The {@code to} class * may in turn have its own dependencies. diff --git a/src/main/java/xades4j/production/XadesTSigningProfile.java b/src/main/java/xades4j/production/XadesTSigningProfile.java index 295b8442..dd8d31d0 100644 --- a/src/main/java/xades4j/production/XadesTSigningProfile.java +++ b/src/main/java/xades4j/production/XadesTSigningProfile.java @@ -22,22 +22,29 @@ /** * A profile for producing XAdES-T signatures. A {@link KeyingDataProvider} has * to be supplied. The library has a default {@link xades4j.providers.TimeStampTokenProvider} - * that will be used to configure the {@code XadesSigner}. As all teh other components + * that will be used to configure the {@code XadesSigner}. As all the other components * it can be exchanged. *

* A {@link SignaturePolicyInfoProvider} should be added to produce a XAdES-T based * on XAdES-EPES. * @see XadesSigningProfile + * @see XadesCSigningProfile * @author Luís */ public class XadesTSigningProfile extends XadesSigningProfile { + /** + * @see XadesTSigningProfile + */ public XadesTSigningProfile( Class keyingProviderClass) { super(keyingProviderClass); } + /** + * @see XadesTSigningProfile + */ public XadesTSigningProfile(KeyingDataProvider keyingProvider) { super(keyingProvider); diff --git a/src/main/java/xades4j/providers/ValidationData.java b/src/main/java/xades4j/providers/ValidationData.java index dad94b39..014df973 100644 --- a/src/main/java/xades4j/providers/ValidationData.java +++ b/src/main/java/xades4j/providers/ValidationData.java @@ -26,7 +26,8 @@ * Container of validation data (certificates and corresponding CRLs). *

* Contains the full certification chain, starting with the signing certificate - * and endind with the trust-anchor. + * and ending with the trust-anchor. Depending on verification profile, it may or may not + * contain CRLs used for checking the revocation information of certificates. * @author Luís */ public class ValidationData diff --git a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java index a4341c00..ae6979bd 100644 --- a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java @@ -120,7 +120,7 @@ protected BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreatePrope */ boolean certificateValuesPresent = false; boolean revocationValuesPresent = false; - // TODO test with document having only XAdES-X-L (above ones) properties + // TODO test with document extended from T to X-L form without C and X intermediates // requirements from SigAndRefsTimeStamp, only enforce singletonity, not presence boolean completeCertRefsPresent = false; diff --git a/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java b/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java index d7317727..24654e73 100644 --- a/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java +++ b/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java @@ -124,11 +124,18 @@ public List verifyProperties( * properties, that is, we found the first property that should have been * signed by SigAndRefsTimeStamp. * + * With SignatureTimeStamp similar situation occurs when there are only + * SignedProperties left or all properties have been handled + * * TODO The situation is even more complex in the unsupported case of * RefsOnlyTimeStamp. * - * With SignatureTimeStamp similar situation occurs when there are only - * SignedProperties left or all properties have been handled + * TODO handle gracefully multiple ArchiveTimeStamps with similar times + * The above described behavior may cause failure of verification for one + * of the ArchiveTimeStamps if there are multiple ArchiveTimeStamps present, + * but it won't cause failure in verification of the whole signature. + * If the first ArchiveTimeStamp is invalid, it won't change the time, so the + * second one will verify successfully. */ try { // when we encounter property that needs to be signed by diff --git a/src/main/java/xades4j/verification/SignatureSpecificVerificationOptions.java b/src/main/java/xades4j/verification/SignatureSpecificVerificationOptions.java index da7e0502..8005f264 100644 --- a/src/main/java/xades4j/verification/SignatureSpecificVerificationOptions.java +++ b/src/main/java/xades4j/verification/SignatureSpecificVerificationOptions.java @@ -26,7 +26,8 @@ * Represents verification options that are specific to a signature, i.e., options * that are not profile-wide. *

- * It includes base URI, data for anonymous references or resource resolvers + * It includes base URI for file containing signature, data for anonymous references + * or resource resolvers (used to retrieve external files referenced by signature). * * @see xades4j.verification.XadesVerifier * @author Luís diff --git a/src/main/java/xades4j/verification/XAdESVerificationResult.java b/src/main/java/xades4j/verification/XAdESVerificationResult.java index ab619eaf..c0b18389 100644 --- a/src/main/java/xades4j/verification/XAdESVerificationResult.java +++ b/src/main/java/xades4j/verification/XAdESVerificationResult.java @@ -17,9 +17,10 @@ package xades4j.verification; import java.security.cert.X509Certificate; -import java.util.ArrayList; import java.util.Collection; import org.apache.xml.security.signature.XMLSignature; + +import xades4j.properties.BaseXAdESTimeStampProperty; import xades4j.properties.QualifyingProperties; import xades4j.properties.QualifyingProperty; import xades4j.properties.SignedDataObjectProperty; @@ -103,28 +104,41 @@ private QualifyingProperties createQualifProps() /**/ /**/ + /** + * @return the form of signature (BES, EPES, T, C, X, X-L, A) + */ public XAdESForm getSignatureForm() { return signatureForm; } + /** + * @return the validated basic XMLDsig object + */ public XMLSignature getXmlSignature() { return xmlSignature; } + /** + * @return the signature algorithm used by the basic XML digital signature + */ public String getSignatureAlgorithmUri() { return xmlSignature.getSignedInfo().getSignatureMethodURI(); } + /** + * the canonicalization algorithm used by the basic XML digital signature + * @return + */ public String getCanonicalizationAlgorithmUri() { return xmlSignature.getSignedInfo().getCanonicalizationMethodURI(); } /** - * Gets the certificates and CRLs used to verify the signature. + * Gets all the certificates and CRLs used to verify the basic signature. * @return the validation data */ public ValidationData getValidationData() @@ -181,7 +195,11 @@ public Collection getSignedDataObjects() } /** - * returns validation data (certs and CRLs used to verify time stamps + * Returns all validation data (certs and CRLs) used to verify time stamps. + *

+ * If you're interested in validation data of single property, all time stamp + * property objects implement {@link BaseXAdESTimeStampProperty} interface, which + * defines the {@code getValidationData()} method. * @return */ public Collection getAttributeValidationData() diff --git a/src/main/java/xades4j/verification/XadesVerificationProfile.java b/src/main/java/xades4j/verification/XadesVerificationProfile.java index 2a31bed6..9c141692 100644 --- a/src/main/java/xades4j/verification/XadesVerificationProfile.java +++ b/src/main/java/xades4j/verification/XadesVerificationProfile.java @@ -40,7 +40,8 @@ * verify signatures using the configured components. *

* The minimum configuration is a {@link xades4j.providers.CertificateValidationProvider} - * because the validation data (trust-anchors, CRLs, etc) has to be properly selected. All the other components + * because the validation data (trust-anchors, CRLs, etc) has to be properly selected. + * All the other components * have default implementations that are used if no other actions are taken. However, * all of them can be replaced through the corresponding methods, either by an instance * or a class. When a class is used it may have dependencies on other components, @@ -88,7 +89,7 @@ public XadesVerificationProfile( /** * Certificate validation profile that can be used to validate both signature and - * time stamps in Advanced Electronic Signatures. + * time stamps in XML Advanced Electronic Signatures. * * @param certificateValidationProvider validation data and provider to be used for * validation Signature only @@ -174,6 +175,7 @@ public XadesVerificationProfile withBinding( * not be affected. Other verifiers can be created, accumulating the profile changes. * @return a {@code XadesVerifier} accordingly to this profile. * @throws XadesProfileResolutionException if the dependencies of the signer (direct and indirect) cannot be resolved + * @see XadesVerifier */ public final XadesVerifier newVerifier() throws XadesProfileResolutionException { @@ -322,7 +324,7 @@ public XadesVerificationProfile withCustomSignatureVerifier( } public XadesVerificationProfile withElementVerifier( - QName elemName, Class vClass) + QName elemName, Class> vClass) { if (null == elemName || null == vClass) throw new NullPointerException(); diff --git a/src/main/java/xades4j/verification/XadesVerifier.java b/src/main/java/xades4j/verification/XadesVerifier.java index 89ba3e71..04ae3725 100644 --- a/src/main/java/xades4j/verification/XadesVerifier.java +++ b/src/main/java/xades4j/verification/XadesVerifier.java @@ -39,30 +39,51 @@ * handling by catching exceptions in the different branches/depths of the tree. *

* With its default configuration the library supports verification of signatures - * up to XAdES-C. The format can be extended after verification through the {@link #verify(org.w3c.dom.Element, xades4j.verification.SignatureSpecificVerificationOptions, xades4j.production.XadesSignatureFormatExtender, xades4j.verification.XAdESForm) verify} - * method, even though extended formats cannot be validated afterwards. + * up to and including XAdES-A. The format can be extended after verification through the + * {@link #verify(org.w3c.dom.Element, xades4j.verification.SignatureSpecificVerificationOptions, xades4j.production.XadesSignatureFormatExtender, xades4j.verification.XAdESForm) verify} + * method. * @see XadesVerificationProfile * @author Luís */ public interface XadesVerifier { /** - * Verifies a signature. - * @param signatureElem the element containing the signature; must have an Id + * Verifies a signature. Checks if it is correctly formed, if required properties are + * present for the detected form, etc. + *

+ * It does not check whatever: + *

    + *
  • the complete signature is as as minimal as possible (there is no duplication + * of certificates or CRLs)
  • + *
  • grace periods for signature and subsequent TimeStamps are preserved
  • + *
+ *

+ * Limitations:
XAdES-C won't include the {@code AttributeCertificateRefs} + * and {@code AttributeRevocationRefs} properties. The library can't verify + * signatures that use OCSP responses for revocation information source. + * The library can't verify XAdES-X type 2 documents (the + * {@code RefsOnlyTimeStamp} property).

+ *
+ * @param signatureElem the element containing the signature; must have an {@code Id} + * attribute * @param verificationOptions signature verification options. If {@code null}, - * default options are used - * @return the verification result + * default options are used, see: {@link SignatureSpecificVerificationOptions} + * @return the verification result (if verification successful) * * @see xades4j.verification.SignatureSpecificVerificationOptions - * @throws XAdES4jException if an error occurs, including if signature verification fails + * @throws XAdES4jException if during verification a critical error occurs, causing + * signature verification failure. Failure to validate single element if there + * are other elements able to provide unbroken chain of time stamps will + * not cause an Exception to be thrown. * @throws NullPointerException if {@code signatureElem} is {@code null} + * @see XadesVerifier */ public XAdESVerificationResult verify( Element signatureElem, SignatureSpecificVerificationOptions verificationOptions) throws XAdES4jException; /** - * Verifies a signature and extends its format if needed. + * Verifies a signature and extends its format. *

* Note that, due to the library's internal design, the properties being added * to a signature cannot have dependencies on each other because the XML for @@ -70,34 +91,68 @@ public XAdESVerificationResult verify( * all the data needed to the properties. For instance, it's not possible to * correctly add properties from XAdES-C and XAdES-X at the same time, as the * last need the first's XML structure. This imposes some restrictions on the - * format extensions. Valid transitions are (actual signature form -> form - * after extension): + * format extensions. To work around this limitation you can first extend the form to + * XAdES-C form and then to XAdES-X form. + *

+ * Valid transitions are (actual signature form -> form after extension): *

    *
  • BES/EPES -> T
  • *
  • BES/EPES -> C
  • + *
  • T -> T
  • *
  • T -> C
  • + *
  • T -> X-L (not supported)
  • *
  • C -> X
  • *
  • C -> X-L
  • - *
  • X -> X-L (not supported by default because X cannot be verified)
  • - *
  • X-L -> A (not supported by default because X-L cannot be verified)
  • + *
  • X -> X
  • + *
  • X -> X-L
  • + *
  • X-L -> A
  • + *
  • A -> A
  • + *
  • A -> A-VD
  • *
+ * Note: {@code A-VD} form is an abstract form, that's used inside this library + * to notify the extender that we want to add {@code TimeStampVerificationData} + * property. TimeStampVerificationData is used to contain data needed to validate + * previous TimeStamps. Validation of A-VD form will return the A form so + * subsequent A-TimeStamping of A-VD form is possible.

+ *

+ * Caution: While the library allows you to extend BES form to A form with + * validation data in matter of seconds, this process may not create actually valid + * signature. This is caused by the fact that law in some countries (and general good + * practice) dictates presence of grace period (See: ETSI TS 101 903, "XAdES standard" + * v. 1.4.2, section 4.4.3.2, NOTE 4). This poses time limits on signature form + * extension. For example, if the grace period is 1h, you may not extend T form to + * C form earlier than 1h after T form creation (it may be longer if you're unable + * to obtain CRL published 1h after T form creation). Same issue exists when + * extending from T form to X-L form, from X form to X-L form and from A form to + * A-VD form. The lack of actual enforcement of this is caused by lack of support + * for grace period in underlying interface (Java crypto API) and used cryptographic + * library (Bouncy Castle). + *

+ *

* Note that the {@code XadesSignatureFormatExtender} can also be used separately, - * but no checks are made to ensure that the signature has the appropriate - * properties (form) to be extended with other properties. This can be used - * to created XAdES-A. + * but then no checks are made to ensure that the signature has the appropriate + * properties (form) to be extended with other properties. *

* The generated XAdES-X is type 1, with one {@code SigAndRefsTimeStamp} property. *

- * Limitations: XAdES-C won't include the {@code AttributeCertificateRefs} - * and {@code AttributeRevocationRefs} properties. XAdES-X-L won't include the - * {@code AttrAuthoritiesCertValues} and {@code AttributeRevocationValues} properties. + * Limitations: + *

    + *
  • XAdES-C won't include the optional {@code AttributeCertificateRefs} + * and {@code AttributeRevocationRefs} properties
  • + *
  • library can't verify or create signatures that use OCSP responses for + * revocation information
  • + *
  • library can't verify XAdES-X type 2 or documents that build on it + * (the {@code RefsOnlyTimeStamp} property) + *
  • + *
* * @param signatureElem the element containing the signature; must have an Id * @param verificationOptions signature verification options. If {@code null}, * default options are used * @param formatExtender the extender used to add the new unsigned properties * @param minForm the minimum format that the signature should have; if the - * original signature has a 'lower' format, the extender is used + * original signature has a 'lower' format (as per list above), the extender + * is used * @return the verification result * * @see xades4j.production.XadesFormatExtenderProfile diff --git a/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java b/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java index c90c4cf5..a95a7845 100644 --- a/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java +++ b/src/test/java/xades4j/verification/SurrogateTimeStampTokenProvider.java @@ -58,7 +58,8 @@ import xades4j.providers.TimeStampTokenProvider; /** - * TimeStampTokenProvider that uses its own internal time source and generator + * TimeStampTokenProvider that uses its own internal time source and generator. + * In other words, an off-line time stamp token generator. To be used only for tests. * @author Hubert Kario * */ From 3c9961249d11e8349746c8c6cbb72b314c2c6213 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Thu, 20 Dec 2012 14:03:26 +0100 Subject: [PATCH 57/84] make certs and CRLs saved in properties unique If there are multiple timestamps signed by the same TSA, both the certificate and CRL used to veriy it will be saved multiple times. Signed-off-by: Tiago Rossi --- src/main/java/xades4j/utils/PropertiesUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/xades4j/utils/PropertiesUtils.java b/src/main/java/xades4j/utils/PropertiesUtils.java index 95da5aa0..5d1a4971 100644 --- a/src/main/java/xades4j/utils/PropertiesUtils.java +++ b/src/main/java/xades4j/utils/PropertiesUtils.java @@ -20,6 +20,7 @@ import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; import xades4j.properties.ArchiveTimeStampProperty; import xades4j.properties.AttrAuthoritiesCertValuesProperty; @@ -89,8 +90,8 @@ public static void addXadesXLProperties( usp.add(new CertificateValuesProperty(vData.getCerts())); usp.add(new RevocationValuesProperty(vData.getCrls())); - Collection allTSACerts = new ArrayList(); - Collection allTSACRLs = new ArrayList(); + Collection allTSACerts = new HashSet(); + Collection allTSACRLs = new HashSet(); for (ValidationData valData : tstValData) { allTSACerts.addAll(valData.getCerts()); @@ -110,8 +111,8 @@ public static void addXadesAVDProperties( Collection usp, Collection attributeValidationData) { - Collection certificates = new ArrayList(); - Collection crls = new ArrayList(); + Collection certificates = new HashSet(); + Collection crls = new HashSet(); for (ValidationData valData : attributeValidationData) { certificates.addAll(valData.getCerts()); From 4e6ae87aa0ce2587c63d86e48e3839145420ce15 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Thu, 20 Dec 2012 16:41:58 +0100 Subject: [PATCH 58/84] add only non duplicated data to A-VD form We only need to add a certificate once to XAdES signature. This change makes the generated signatures smaller. Signed-off-by: Tiago Rossi --- .../java/xades4j/utils/PropertiesUtils.java | 155 +++++++++++++++++- .../verification/XadesHybridVerifierImpl.java | 14 +- 2 files changed, 159 insertions(+), 10 deletions(-) diff --git a/src/main/java/xades4j/utils/PropertiesUtils.java b/src/main/java/xades4j/utils/PropertiesUtils.java index 5d1a4971..a654a20d 100644 --- a/src/main/java/xades4j/utils/PropertiesUtils.java +++ b/src/main/java/xades4j/utils/PropertiesUtils.java @@ -22,12 +22,16 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; + +import xades4j.properties.AllDataObjsTimeStampProperty; import xades4j.properties.ArchiveTimeStampProperty; import xades4j.properties.AttrAuthoritiesCertValuesProperty; import xades4j.properties.AttributeRevocationValuesProperty; +import xades4j.properties.BaseXAdESTimeStampProperty; import xades4j.properties.CertificateValuesProperty; import xades4j.properties.CompleteCertificateRefsProperty; import xades4j.properties.CompleteRevocationRefsProperty; +import xades4j.properties.IndividualDataObjsTimeStampProperty; import xades4j.properties.RevocationValuesProperty; import xades4j.properties.SigAndRefsTimeStampProperty; import xades4j.properties.SignaturePolicyBase; @@ -37,6 +41,7 @@ import xades4j.properties.UnsignedSignatureProperty; import xades4j.providers.SignaturePolicyInfoProvider; import xades4j.providers.ValidationData; +import xades4j.verification.XAdESVerificationResult; /** * @@ -44,6 +49,8 @@ */ public class PropertiesUtils { + private static final long ONE_WEEK = 7 * 24 * 60 * 60 * 1000; + private PropertiesUtils() { } @@ -109,15 +116,149 @@ public static void addXadesAProperties( public static void addXadesAVDProperties( Collection usp, - Collection attributeValidationData) + XAdESVerificationResult res) { - Collection certificates = new HashSet(); - Collection crls = new HashSet(); - for (ValidationData valData : attributeValidationData) + /* + * The problem: the only CRLs that can contribute to validation of already + * time stamped time stamps (SigAndRefsTimeStamp when the last time stamp is + * AchiveTimeStamp) are ones that have been published after the time of last + * time stamp. See "grace period" in XAdES standard. + * + * The problem is multiplied by the fact, that we can have multiple + * ArchiveTimeStamps from different TSAs created in short succession. + * + * To detect which CRLs are published after the grace period, we assume that the + * sum of grace period time and the difference between time of creation of + * ArchiveTimeStamps is no greater than 1 week. + * We then add only CRLs that have been published a week after + */ + Collection allCertificates = new HashSet(); + Collection crlsAfterGracePeriod = new HashSet(); + + Collection timeStamps = new ArrayList( + res.getPropertiesFilter().getOfType(AllDataObjsTimeStampProperty.class)); + timeStamps.addAll( + res.getPropertiesFilter().getOfType(IndividualDataObjsTimeStampProperty.class)); + timeStamps.addAll( + res.getPropertiesFilter().getOfType(SignatureTimeStampProperty.class)); + timeStamps.addAll( + res.getPropertiesFilter().getOfType(SigAndRefsTimeStampProperty.class)); + timeStamps.addAll( + res.getPropertiesFilter().getOfType(ArchiveTimeStampProperty.class)); + + /* get validation data that may be useful to add to TimeStampValidationData */ + for (BaseXAdESTimeStampProperty ts : timeStamps) + { + allCertificates.addAll(ts.getValidationData().getCerts()); + + for (X509CRL crl : ts.getValidationData().getCrls()) + { + // see big comment above + if (ts.getTime().getTime() + ONE_WEEK < crl.getThisUpdate().getTime()) + crlsAfterGracePeriod.add(crl); + } + } + + Collection savedCertificates = new ArrayList(); + Collection savedCRLs = new ArrayList(); + + // collect all CRLs already present in signature + Collection revValProps = + res.getPropertiesFilter().getOfType(RevocationValuesProperty.class); + Collection attrRevValProps = + res.getPropertiesFilter().getOfType(AttributeRevocationValuesProperty.class); + Collection tsValDatProps = + res.getPropertiesFilter().getOfType(TimeStampValidationDataProperty.class); + for (RevocationValuesProperty revValProp : revValProps) + { + savedCRLs.addAll(revValProp.getCrls()); + } + for (AttributeRevocationValuesProperty attrRevValProp : attrRevValProps) + { + savedCRLs.addAll(attrRevValProp.getCrls()); + } + for (TimeStampValidationDataProperty tsValDataProp : tsValDatProps) + { + savedCRLs.addAll(tsValDataProp.getCrls()); + savedCertificates.addAll(tsValDataProp.getCertificates()); + } + + // collect all certificates specified in properties (there can be certificates + // in time stamp tokens or basic XML signature KeyInfo, but duplication of them + // is not an error in itself) + Collection certValProps = + res.getPropertiesFilter().getOfType(CertificateValuesProperty.class); + Collection attrAuthCerValProps = + res.getPropertiesFilter().getOfType(AttrAuthoritiesCertValuesProperty.class); + for (CertificateValuesProperty cvProp : certValProps) + { + savedCertificates.addAll(cvProp.getCertificates()); + } + for (AttrAuthoritiesCertValuesProperty aacvProp : attrAuthCerValProps) + { + savedCertificates.addAll(aacvProp.getCertificates()); + } + + // remove already saved validation information + Collection certsToSave = + new ArrayList(allCertificates); + Collection crlsToSave = new ArrayList(crlsAfterGracePeriod); + certsToSave.removeAll(savedCertificates); + crlsToSave.removeAll(savedCRLs); + + usp.add(new TimeStampValidationDataProperty(certsToSave, crlsToSave)); + } + + /** + * Walk over all properties with time stamps that can appear before X-L form + * creation and extract Validation Data from each and every one of them. + */ + public static Collection extractTTimeStampValidationData( + XAdESVerificationResult res) + { + Collection tTimeStampValidationData = + new ArrayList(); + + /* + * Collect validation data of properties previous to the last time stamp + * (SigAndRefsTimeStamp or RefsOnlyTimeStamp). + * + * This is done because the SigAndRefsTimeStamp must be valid using + * current revocation information, the previous time stamps may be invalid + * using currently available revocation information. In effect we save + * only the information that will not change in future. + * + * To reduce amount of information needed to add in the future, we add all + * certificates needed to verify the SigAndRefsTimeStamp too + */ + Collection allDataObjTSProps = + res.getPropertiesFilter().getOfType(AllDataObjsTimeStampProperty.class); + Collection indivDataObjTSProps = + res.getPropertiesFilter().getOfType(IndividualDataObjsTimeStampProperty.class); + Collection sigTSProps = + res.getPropertiesFilter().getOfType(SignatureTimeStampProperty.class); + Collection sigAndRefsProps = + res.getPropertiesFilter().getOfType(SigAndRefsTimeStampProperty.class); + + for (AllDataObjsTimeStampProperty tsProp : allDataObjTSProps) + { + tTimeStampValidationData.add(tsProp.getValidationData()); + } + for (IndividualDataObjsTimeStampProperty tsProp : indivDataObjTSProps) + { + tTimeStampValidationData.add(tsProp.getValidationData()); + } + for (SignatureTimeStampProperty tsProp : sigTSProps) + { + tTimeStampValidationData.add(tsProp.getValidationData()); + } + for (SigAndRefsTimeStampProperty tsProp : sigAndRefsProps) { - certificates.addAll(valData.getCerts()); - crls.addAll(valData.getCrls()); + ValidationData savedValData; + savedValData = tsProp.getValidationData(); + ValidationData newValData = new ValidationData(savedValData.getCerts()); + tTimeStampValidationData.add(newValData); } - usp.add(new TimeStampValidationDataProperty(certificates, crls)); + return tTimeStampValidationData; } } diff --git a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java index e1d16b40..19f53488 100644 --- a/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java +++ b/src/main/java/xades4j/verification/XadesHybridVerifierImpl.java @@ -384,8 +384,12 @@ public void addProps( XAdESVerificationResult res) { PropertiesUtils.addXadesXProperties(usp); + + Collection tTimeStampValidationData = + PropertiesUtils.extractTTimeStampValidationData(res); + PropertiesUtils.addXadesXLProperties(usp, res.getValidationData(), - res.getAttributeValidationData()); + tTimeStampValidationData); } }; formsExtensionTransitions[XAdESForm.C.ordinal()][XAdESForm.X_L.ordinal()] = xlAndXPropsCol; @@ -397,11 +401,15 @@ public void addProps( public void addProps(Collection usp, XAdESVerificationResult res) { + Collection tTimeStampValidationData = + PropertiesUtils.extractTTimeStampValidationData(res); + PropertiesUtils.addXadesXLProperties( usp, res.getValidationData(), - res.getAttributeValidationData()); + tTimeStampValidationData); } + }; formsExtensionTransitions[XAdESForm.X.ordinal()][XAdESForm.X_L.ordinal()] = xlPropsCol; @@ -426,7 +434,7 @@ public void addProps(Collection usp, public void addProps(Collection usp, XAdESVerificationResult res) { - PropertiesUtils.addXadesAVDProperties(usp, res.getAttributeValidationData()); + PropertiesUtils.addXadesAVDProperties(usp, res); } }; formsExtensionTransitions[XAdESForm.A.ordinal()][XAdESForm.A_VD.ordinal()] = avdPropsCol; From 47f4f407de968aab79220d97ab21bf7631923f25 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 23 Dec 2012 15:58:38 +0100 Subject: [PATCH 59/84] consider parameters individually in tsValDataProp Signed-off-by: Tiago Rossi --- .../xades4j/properties/TimeStampValidationDataProperty.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/xades4j/properties/TimeStampValidationDataProperty.java b/src/main/java/xades4j/properties/TimeStampValidationDataProperty.java index 9d546bc9..3caba07a 100644 --- a/src/main/java/xades4j/properties/TimeStampValidationDataProperty.java +++ b/src/main/java/xades4j/properties/TimeStampValidationDataProperty.java @@ -48,8 +48,8 @@ public class TimeStampValidationDataProperty extends UnsignedSignatureProperty public TimeStampValidationDataProperty(Collection certificates, Collection crls) { - if ((certificates == null && crls == null) || - (certificates.isEmpty() && crls.isEmpty())) + if ((certificates == null || certificates.isEmpty()) && + ((crls == null) || crls.isEmpty())) throw new NullPointerException("Both parameters can't be null/empty"); this.certificateValues = certificates; From 72ad4f38cc865907cca32bdfcb5ad014b9dae293 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 23 Dec 2012 16:04:39 +0100 Subject: [PATCH 60/84] don't assume presence of data in TSValData property Signed-off-by: Tiago Rossi --- ...omXmlTimeStampValidationDataConverter.java | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java b/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java index 27de6261..c80b90fa 100644 --- a/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java +++ b/src/main/java/xades4j/xml/unmarshalling/FromXmlTimeStampValidationDataConverter.java @@ -55,35 +55,42 @@ public void convertFromObject( for (XmlValidationDataType xmlVDT : xmlTimeStampValidationData) { - XmlCertificateValuesType xmlCertificateValues = xmlVDT.getCertificateValues(); - - List certValues = xmlCertificateValues.getEncapsulatedX509CertificateOrOtherCertificate(); - for (Object item : certValues) + if (xmlVDT.getCertificateValues() != null) { - if (item instanceof XmlEncapsulatedPKIDataType) + XmlCertificateValuesType xmlCertificateValues = xmlVDT.getCertificateValues(); + + List certValues = xmlCertificateValues.getEncapsulatedX509CertificateOrOtherCertificate(); + for (Object item : certValues) { - XmlEncapsulatedPKIDataType cert = (XmlEncapsulatedPKIDataType) item; - timeStampValidationDataData.addCertificateData(cert.getValue()); + if (item instanceof XmlEncapsulatedPKIDataType) + { + XmlEncapsulatedPKIDataType cert = (XmlEncapsulatedPKIDataType) item; + timeStampValidationDataData.addCertificateData(cert.getValue()); + } + if (item instanceof XmlAnyType) + throw new PropertyUnmarshalException("Property not supprted", "OtherCertificate"); } - if (item instanceof XmlAnyType) - throw new PropertyUnmarshalException("Property not supprted", "OtherCertificate"); } XmlRevocationValuesType xmlRevocationValues = xmlVDT.getRevocationValues(); - XmlCRLValuesType crlValues = xmlRevocationValues.getCRLValues(); - List crls = crlValues.getEncapsulatedCRLValue(); - for (XmlEncapsulatedPKIDataType crl : crls) + if (xmlRevocationValues != null && xmlRevocationValues.getCRLValues() != null) { - timeStampValidationDataData.addCRLData(crl.getValue()); - } + XmlCRLValuesType crlValues = xmlRevocationValues.getCRLValues(); + List crls = crlValues.getEncapsulatedCRLValue(); + for (XmlEncapsulatedPKIDataType crl : crls) + { + timeStampValidationDataData.addCRLData(crl.getValue()); + } - // check for unsupported data - if (xmlRevocationValues.getOCSPValues() != null) - throw new PropertyUnmarshalException("OCSP responses are unsupported", - "TimeStampValidationData"); - if (xmlRevocationValues.getOtherValues() != null) - throw new PropertyUnmarshalException("Other (not CRL and not OCSP) " + - "certificate revocation values unsupported", "TimeStampValidationData"); + // check for unsupported data + if (xmlRevocationValues.getOCSPValues() != null) + throw new PropertyUnmarshalException("OCSP responses are unsupported", + "TimeStampValidationData"); + if (xmlRevocationValues.getOtherValues() != null) + throw new PropertyUnmarshalException("Other (not CRL and not OCSP) " + + "certificate revocation values unsupported", + "TimeStampValidationData"); + } } propertyDataCollector.addTimeStampValidationDataData(timeStampValidationDataData); From 4b333a71caa2592b0e80de10529b860ec2a74da8 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 23 Dec 2012 16:09:35 +0100 Subject: [PATCH 61/84] don't try to create empty TSVerData property Signed-off-by: Tiago Rossi --- src/main/java/xades4j/utils/PropertiesUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/xades4j/utils/PropertiesUtils.java b/src/main/java/xades4j/utils/PropertiesUtils.java index a654a20d..0185fc8c 100644 --- a/src/main/java/xades4j/utils/PropertiesUtils.java +++ b/src/main/java/xades4j/utils/PropertiesUtils.java @@ -206,7 +206,9 @@ public static void addXadesAVDProperties( certsToSave.removeAll(savedCertificates); crlsToSave.removeAll(savedCRLs); - usp.add(new TimeStampValidationDataProperty(certsToSave, crlsToSave)); + // don't create empty property + if ((!certsToSave.isEmpty()) || (!crlsToSave.isEmpty())) + usp.add(new TimeStampValidationDataProperty(certsToSave, crlsToSave)); } /** From 3f30b7ad0b425dab861b6b3624056ef374ebbe0e Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 23 Dec 2012 16:12:50 +0100 Subject: [PATCH 62/84] remove verifyAextendAVD test because those tests are made using current time and the same TSA, TimeStampVerificationData won't have any data and as such won't be created Signed-off-by: Tiago Rossi --- .../java/xades4j/verification/XadesVerifierImplTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/xades4j/verification/XadesVerifierImplTest.java b/src/test/java/xades4j/verification/XadesVerifierImplTest.java index 344a6589..7505800b 100644 --- a/src/test/java/xades4j/verification/XadesVerifierImplTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierImplTest.java @@ -33,7 +33,6 @@ import xades4j.properties.QualifyingProperty; import xades4j.properties.RevocationValuesProperty; import xades4j.properties.SigAndRefsTimeStampProperty; -import xades4j.properties.TimeStampValidationDataProperty; /** * @@ -297,7 +296,10 @@ public void testVerifyAEnrichAVD() throws Exception signatureNode, null, formExt, XAdESForm.A_VD); assertEquals(XAdESForm.A, res.getSignatureForm()); - assertPropXAdES141ElementPresent(signatureNode, TimeStampValidationDataProperty.PROP_NAME); + // TODO recent changes to verifier made the property generated only when needed, + // as all information that would be stored in it is already present in other + // properties, the property won't be created + //assertPropXAdES141ElementPresent(signatureNode, TimeStampValidationDataProperty.PROP_NAME); outputDocument(doc, "document.verified.c.xl.avd.xml"); } From 1f418e600399035eb50f7f14ed7b92cd5a560a71 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 23 Dec 2012 16:21:42 +0100 Subject: [PATCH 63/84] update AgedTimeStampTest for new TSValData creator TimeStampValidationData creator tries not to put CRLs that weren't published after last time stamping of the document, because of that, tests that use certificates with very short validity (and quickly extends to advanced forms) can't depend on certificates and CRLs added by TimeStampValidationData Signed-off-by: Tiago Rossi --- .../java/xades4j/verification/AgedTimeStampTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index bbb7ad7c..60d96252 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -168,7 +168,9 @@ public class AgedTimeStampTest private static TSACertificateValidationProvider test03_tsaCertValidationDataProviderXCreation; private static TSACertificateValidationProvider test03_tsaCertValidationDataProviderACreation; private static TSACertificateValidationProvider test03_tsaCertValidationDataProviderAnow; + /** validation data with only trust anchors (no CRLs or certificates) */ private static CertificateValidationProvider test03_userCertMinimalValidationDataProvider; + /** validation data with only trust anchors and current CRLs */ private static TSACertificateValidationProvider test03_tsaCertMinimalValidationDataProvider; private static final long ONE_HOUR_IN_MS = 60 * 60 * 1000; @@ -722,11 +724,16 @@ private static void createXadesACerts(Date now) true, emptyCertStore); + content = new ArrayList(); + content.add(test03_A_tsaCRL_3); + CertStore aValidationCrlsOnly = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); test03_tsaCertMinimalValidationDataProvider = new PKIXTSACertificateValidationProvider( test03_A_tsaTrustAnchors, true, - emptyCertStore); + aValidationCrlsOnly); } @Test From a86604659129b2defeb1263d8ee54d3e9514241a Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sun, 23 Dec 2012 23:50:42 +0100 Subject: [PATCH 64/84] fix subCA cert creation Signed-off-by: Tiago Rossi --- src/test/java/xades4j/verification/FullCert.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/xades4j/verification/FullCert.java b/src/test/java/xades4j/verification/FullCert.java index e5bc2284..11a84f8c 100644 --- a/src/test/java/xades4j/verification/FullCert.java +++ b/src/test/java/xades4j/verification/FullCert.java @@ -379,7 +379,7 @@ public FullCert createSubCACert( boolean isCA = true; int keyUsage = KeyUsage.digitalSignature | KeyUsage.keyEncipherment - | KeyUsage.dataEncipherment; + | KeyUsage.dataEncipherment | KeyUsage.keyCertSign | KeyUsage.cRLSign; boolean extendedAttrCritical = false; KeyPurposeId[] extendedAttr = null; From 38b6303c67a1538249f7d582644d75e8006a04e1 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 24 Dec 2012 15:51:49 +0100 Subject: [PATCH 65/84] realistic tests add tests with time stamp validity measured in years, multiple timestamps per each form, etc. Signed-off-by: Tiago Rossi --- .../verification/AgedTimeStampTest.java | 2039 +++++++++++++++-- 1 file changed, 1853 insertions(+), 186 deletions(-) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index 60d96252..b1f84da1 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -18,6 +18,7 @@ import static org.junit.Assert.assertEquals; +import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -25,6 +26,7 @@ import java.math.BigInteger; import java.security.InvalidAlgorithmParameterException; import java.security.KeyStore; +import java.security.KeyStore.Entry; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; @@ -54,8 +56,6 @@ import org.apache.xml.security.utils.Constants; import org.bouncycastle.asn1.x509.CRLReason; -import org.bouncycastle.cert.jcajce.JcaCertStore; -import org.bouncycastle.util.Store; import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -99,7 +99,6 @@ public class AgedTimeStampTest private static X509CRL test01_T_tsaCRL_1; private static X509CRL test01_T_userCRL_2; private static X509CRL test01_T_tsaCRL_2; - private static Store test01_T_userCaStore; private static KeyStore test01_T_userTrustAnchors; private static KeyStore test01_T_tsaTrustAnchors; @@ -134,7 +133,6 @@ public class AgedTimeStampTest private static FullCert test02_X_tsa2Cert; private static X509CRL test02_X_tsaCRL_1; private static X509CRL test02_X_tsaCRL_2; - private static Store test02_X_userCaStore; private static KeyStore test02_X_userTrustAnchors; private static KeyStore test02_X_tsaTrustAnchors; @@ -158,7 +156,6 @@ public class AgedTimeStampTest private static X509CRL test03_X_tsaCRL_1; private static X509CRL test03_X_tsaCRL_2; private static X509CRL test03_A_tsaCRL_3; - private static Store test03_userCaStore; private static KeyStore test03_userTrustAnchors; private static KeyStore test03_X_tsaTrustAnchors; private static KeyStore test03_A_tsaTrustAnchors; @@ -173,14 +170,46 @@ public class AgedTimeStampTest /** validation data with only trust anchors and current CRLs */ private static TSACertificateValidationProvider test03_tsaCertMinimalValidationDataProvider; + /* + * data for XAdES-A timestamp tests with multiple time stamps + */ + private static FullCert test04_acmeCA; + private static FullCert test04_acmePersonalCA; + private static FullCert test04_willECoyote; + private static FullCert test04_consterCA; + private static FullCert test04_consterTSA17ya; + private static FullCert test04_ascendeusCA; + private static FullCert test04_ascendeusIssuingCA; + private static FullCert test04_ascendeusTSA17ya; + private static FullCert test04_ascendeusTSA13ya; + private static FullCert test04_carpamaCA; + private static FullCert test04_carpamaTSA13ya; + private static FullCert test04_carpamaTSA9ya; + private static FullCert test04_premoxCA; + private static FullCert test04_premoxTSA9ya; + private static FullCert test04_premoxTSA5ya; + private static FullCert test04_gescapeCA; + private static FullCert test04_gescapeTSA5ya; + private static FullCert test04_unibimCA; + private static FullCert test04_unibimTSA1ya; + private static FullCert test04_astronCA; + private static FullCert test04_astronTSA1ya; + private static CertificateValidationProvider test04_certValidationDataProviderCCreation; + private static CertificateValidationProvider test04_certValidationDataProviderOnlyTrustAnchors; + private static final long ONE_HOUR_IN_MS = 60 * 60 * 1000; + private static final long ONE_DAY_IN_MS = 24 * ONE_HOUR_IN_MS; + private static final long ONE_WEEK_IN_MS = 7 * ONE_DAY_IN_MS; + private static final long ONE_YEAR_IN_MS = 52 * ONE_WEEK_IN_MS; + + private static final Date realNow = new Date(); + static { try { - Date now = new Date(); Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); - System.out.println("AgedTimeStampTest start, current time is " + now); + System.out.println("AgedTimeStampTest start, current time is " + realNow); CertStoreParameters emptyParams = new CollectionCertStoreParameters(); emptyCertStore = CertStore.getInstance("Collection", emptyParams ); @@ -190,7 +219,7 @@ public class AgedTimeStampTest * Create cryptographic data for XAdES-T tests * * *****************************************************************************/ - createXadesTCerts(now); + createXadesTCerts(realNow); /* ****************************************************************************** * @@ -198,7 +227,7 @@ public class AgedTimeStampTest * * *****************************************************************************/ - createXadesXCerts(now); + createXadesXCerts(realNow); /* ****************************************************************************** * @@ -206,7 +235,15 @@ public class AgedTimeStampTest * * *****************************************************************************/ - createXadesACerts(now); + createXadesACerts(realNow); + + /* ****************************************************************************** + * + * Create certs for XAdES-A with multiple time stamps + * + * *****************************************************************************/ + + createXadesAmultTSACerts(realNow); } catch (Exception ex) { @@ -258,13 +295,9 @@ private static void createXadesTCerts(Date now) throws Exception, + test01_T_tsaCert.getCertificate().getNotBefore() + " to " + test01_T_tsaCert.getCertificate().getNotAfter()); - List certList = new ArrayList(); - certList.add(test01_T_userCaCert.getCertificate()); - test01_T_userCaStore = new JcaCertStore(certList); - CRLEntries entries = test01_T_userCaCert.new CRLEntries(); // add fictional entry - entries.addEntry(new BigInteger("134"), new Date(), CRLReason.keyCompromise); + entries.addEntry(new BigInteger("134"), realNow, CRLReason.keyCompromise); crl = test01_T_userCaCert.createCRL("SHA256withRSA", new Date(now.getTime() - ONE_HOUR_IN_MS/2), @@ -357,13 +390,223 @@ private static void createXadesTCerts(Date now) throws Exception, test01_T_tsaTrustAnchors, true, tsaIntermCertsAndCrls); } + private static void createXadesAmultTSACerts(Date now) + throws Exception + { + test04_acmeCA = FullCert.getCACert( + "RSA", + 1024, + "CN=ACME Certification Services CA", + new Date(now.getTime() - 20 * ONE_YEAR_IN_MS), + new Date(now.getTime() - 10 * ONE_YEAR_IN_MS), + "SHA1withRSA"); + + test04_acmePersonalCA = test04_acmeCA.createSubCACert( + "RSA", + 1024, + "CN=ACME Personal Certificates CA", + new Date(now.getTime() - 18 * ONE_YEAR_IN_MS), + new Date(now.getTime() - 13 * ONE_YEAR_IN_MS), + new BigInteger("2"), + "SHA1withRSA"); + + test04_willECoyote = test04_acmePersonalCA.createUserCert( + "RSA", + 1024, + "CN=Will E. Coyote", + new Date(now.getTime() - 18 * ONE_YEAR_IN_MS + 45 * ONE_WEEK_IN_MS), + new Date(now.getTime() + ONE_HOUR_IN_MS), + new BigInteger("2"), + "SHA1withRSA"); + + test04_consterCA = FullCert.getCACert( + "RSA", + 1024, + "CN=Conster CA", + new Date(now.getTime() - 18 * ONE_YEAR_IN_MS), + new Date(now.getTime() - 8 * ONE_YEAR_IN_MS), + "SHA1withRSA"); + + test04_consterTSA17ya = test04_consterCA.createTSACert( + "RSA", + 1024, + "CN=Conster Time Server", + new Date(now.getTime() - 17 * ONE_YEAR_IN_MS), + new Date(now.getTime() - 12 * ONE_YEAR_IN_MS), + new BigInteger("2"), + "SHA1withRSA"); + + test04_ascendeusCA = FullCert.getCACert( + "RSA", + 1024, + "CN=Ascendeus Root CA", + new Date(now.getTime() - 17 * ONE_YEAR_IN_MS - 6 * ONE_WEEK_IN_MS), + new Date(now.getTime() - 7 * ONE_YEAR_IN_MS), + "SHA1withRSA"); + + test04_ascendeusIssuingCA = test04_ascendeusCA.createSubCACert( + "RSA", + 1024, + "CN=Ascendeus Issuing CA", + new Date(now.getTime() - 17 * ONE_YEAR_IN_MS - 3 * ONE_WEEK_IN_MS), + new Date(now.getTime() - 7 * ONE_YEAR_IN_MS), + new BigInteger("2"), + "SHA1withRSA"); + + test04_ascendeusTSA17ya = test04_ascendeusIssuingCA.createTSACert( + "RSA", + 1024, + "CN=Ascendeus Time Services", + new Date(now.getTime() - 17 * ONE_YEAR_IN_MS), + new Date(now.getTime() - 12 * ONE_YEAR_IN_MS), + new BigInteger("2"), + "SHA1withRSA"); + + test04_ascendeusTSA13ya = test04_ascendeusIssuingCA.createTSACert( + "RSA", + 1024, + "CN=Ascendeus Time Services", + new Date(now.getTime() - 13 * ONE_YEAR_IN_MS), + new Date(now.getTime() - 8 * ONE_YEAR_IN_MS), + new BigInteger("3"), + "SHA1withRSA"); + + test04_carpamaCA = FullCert.getCACert( + "RSA", + 1024, + "CN=Carpama Certificate Authority", + new Date(now.getTime() - 13 * ONE_YEAR_IN_MS - 12 * ONE_WEEK_IN_MS), + new Date(now.getTime() - 3 * ONE_YEAR_IN_MS), + "SHA1withRSA"); + + test04_carpamaTSA13ya = test04_carpamaCA.createTSACert( + "RSA", + 1024, + "CN=Carpama Time Server", + new Date(now.getTime() - 13 * ONE_YEAR_IN_MS - 6 * ONE_WEEK_IN_MS), + new Date(now.getTime() - 8 * ONE_YEAR_IN_MS), + new BigInteger("3"), + "SHA1withRSA"); + + test04_carpamaTSA9ya = test04_carpamaCA.createTSACert( + "RSA", + 1024, + "CN=Carpama Time Server", + new Date(now.getTime() - 9 * ONE_YEAR_IN_MS - 6 * ONE_WEEK_IN_MS), + new Date(now.getTime() - 4 * ONE_YEAR_IN_MS), + new BigInteger("4"), + "SHA1withRSA"); + + test04_premoxCA = FullCert.getCACert( + "RSA", + 1024, + "CN=Premox CA", + new Date(now.getTime() - 9 * ONE_YEAR_IN_MS - 12 * ONE_WEEK_IN_MS), + new Date(now.getTime() + 1 * ONE_YEAR_IN_MS), + "SHA256withRSA"); + + test04_premoxTSA9ya = test04_premoxCA.createTSACert( + "RSA", + 1024, + "CN=Premox TSA", + new Date(now.getTime() - 9 * ONE_YEAR_IN_MS - 6 * ONE_WEEK_IN_MS), + new Date(now.getTime() - 4 * ONE_YEAR_IN_MS), + new BigInteger("2"), + "SHA256withRSA"); + + test04_premoxTSA5ya = test04_premoxCA.createTSACert( + "RSA", + 1024, + "CN=Premox TSA", + new Date(now.getTime() - 5 * ONE_YEAR_IN_MS - 6 * ONE_WEEK_IN_MS), + new Date(now.getTime() - 6 * ONE_WEEK_IN_MS), + new BigInteger("3"), + "SHA256withRSA"); + + test04_gescapeCA = FullCert.getCACert( + "RSA", + 1024, + "CN=Gescape Certificate Authority", + new Date(now.getTime() - 5 * ONE_YEAR_IN_MS - 12 * ONE_WEEK_IN_MS), + new Date(now.getTime() + 6 * ONE_WEEK_IN_MS), + "SHA256withRSA"); + + test04_gescapeTSA5ya = test04_gescapeCA.createTSACert( + "RSA", + 1024, + "CN=Gescape Time Stamping Authority", + new Date(now.getTime() - 5 * ONE_YEAR_IN_MS - 6 * ONE_WEEK_IN_MS), + new Date(now.getTime() + 6 * ONE_WEEK_IN_MS), + new BigInteger("2"), + "SHA256withRSA"); + + test04_unibimCA = FullCert.getCACert( + "RSA", + 2048, + "CN=Unibim CA", + new Date(now.getTime() - ONE_YEAR_IN_MS - 12 * ONE_WEEK_IN_MS), + new Date(now.getTime() + 9 * ONE_YEAR_IN_MS), + "SHA256withRSA"); + + test04_unibimTSA1ya = test04_unibimCA.createTSACert( + "RSA", + 2048, + "CN=Unibim TSA", + new Date(now.getTime() - ONE_YEAR_IN_MS - 6 * ONE_WEEK_IN_MS), + new Date(now.getTime() + 4 * ONE_YEAR_IN_MS), + new BigInteger("2"), + "SHA256withRSA"); + + test04_astronCA = FullCert.getCACert( + "RSA", + 2048, + "CN=Astron CA", + new Date(now.getTime() - ONE_YEAR_IN_MS - 12 * ONE_WEEK_IN_MS), + new Date(now.getTime() + 9 * ONE_YEAR_IN_MS), + "SHA256withRSA"); + + test04_astronTSA1ya = test04_astronCA.createTSACert( + "RSA", + 2048, + "CN=Astron TSA", + new Date(now.getTime() - ONE_YEAR_IN_MS - 6 * ONE_WEEK_IN_MS - 1 * ONE_DAY_IN_MS), + new Date(now.getTime() + 4 * ONE_YEAR_IN_MS), + new BigInteger("2"), + "SHA256withRSA"); + + Date cCreatTime = new Date(now.getTime() - 17 * ONE_YEAR_IN_MS + + 16 * ONE_DAY_IN_MS); + CRLEntries emptyEntries = test04_acmeCA.new CRLEntries(); + KeyStore trustAnchors = keyStoreForCerts(test04_acmeCA); + X509CRL acmeCRL = test04_acmeCA.createCRL( + "SHA1withRSA", + new Date(cCreatTime.getTime() - 3 * ONE_DAY_IN_MS), + new Date(now.getTime() + 4 * ONE_DAY_IN_MS), + new BigInteger("3"), + emptyEntries); + X509CRL acmePersonalCRL = test04_acmePersonalCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 8 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 16 * ONE_HOUR_IN_MS), + new BigInteger("3"), + emptyEntries); + Collection crls = createCRLCollection(acmeCRL, acmePersonalCRL); + CertStore intermCertsAndCrls = certStoreForCertsAndCrls(crls, + test04_acmeCA.getCertificate(), + test04_acmePersonalCA.getCertificate()); + test04_certValidationDataProviderCCreation = + new PKIXCertificateValidationProvider(trustAnchors, true, intermCertsAndCrls); + + test04_certValidationDataProviderOnlyTrustAnchors = + new PKIXCertificateValidationProvider(trustAnchors, true, emptyCertStore); + } + private static void createXadesXCerts(Date now) throws Exception, CertificateEncodingException, KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, InvalidAlgorithmParameterException, NoSuchProviderException { X509CRL crl; - List certList; TrustedCertificateEntry ca; Collection content; CertStore intermCertsAndCrls; @@ -470,10 +713,6 @@ private static void createXadesXCerts(Date now) throws Exception, new BigInteger("5"), entries_test02); - certList = new ArrayList(); - certList.add(test02_X_userCaCert.getCertificate()); - test02_X_userCaStore = new JcaCertStore(certList); - test02_X_userTrustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); test02_X_userTrustAnchors.load(null); ca = new TrustedCertificateEntry(test02_X_userCaCert.getCertificate()); @@ -536,6 +775,12 @@ private static void createXadesXCerts(Date now) throws Exception, new PKIXCertificateValidationProvider(test02_X_userTrustAnchors, true, emptyCertStore); + content = new ArrayList(); + content.add(test02_X_tsaCRL_2); + + intermCertsAndCrls = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(content)); test02_tsaCertMinimalValidationDataProvider = new PKIXTSACertificateValidationProvider(test02_X_tsaTrustAnchors, true, @@ -783,11 +1028,11 @@ public void test01_T_sig1() throws Exception // test signing SurrogateTimeStampTokenProvider.setTSACert(test01_T_tsaCert); SurrogateTimeStampTokenProvider.setTimeAndSerial( - new Date(new Date().getTime() - ONE_HOUR_IN_MS/2), + new Date(realNow.getTime() - ONE_HOUR_IN_MS/2), new BigInteger("3")); System.out.println("SignatureTimeStamp creation date in " + "\"document.aged.testT_1s\" is " + - new Date(new Date().getTime() - ONE_HOUR_IN_MS/2)); + new Date(realNow.getTime() - ONE_HOUR_IN_MS/2)); Document doc = getDocument("document.xml"); Element elemToSign = doc.getDocumentElement(); @@ -840,14 +1085,14 @@ public void test01_T_ver3() throws Exception // revoke user certificate 15 min ago entries.addEntry(test01_T_userCert.getCertificate().getSerialNumber(), - new Date(new Date().getTime() - ONE_HOUR_IN_MS/4), CRLReason.unspecified); + new Date(realNow.getTime() - ONE_HOUR_IN_MS/4), CRLReason.unspecified); System.out.println("User certificate revoked at " + - new Date(new Date().getTime() - ONE_HOUR_IN_MS/4)); + new Date(realNow.getTime() - ONE_HOUR_IN_MS/4)); // create CRL X509CRL revokedCerts = test01_T_userCaCert.createCRL("SHA1withRSA", - new Date(new Date().getTime() - ONE_HOUR_IN_MS/60), // generated 1 min ago - new Date(new Date().getTime() + ONE_HOUR_IN_MS/2), // nextUpdate in 30 min + new Date(realNow.getTime() - ONE_HOUR_IN_MS/60), // generated 1 min ago + new Date(realNow.getTime() + ONE_HOUR_IN_MS/2), // nextUpdate in 30 min new BigInteger("4"), entries); @@ -879,14 +1124,14 @@ public void test01_T_ver3_1() throws Exception // revoke user certificate 15 min ago entries.addEntry(test01_T_userCert.getCertificate().getSerialNumber(), - new Date(new Date().getTime() - ONE_HOUR_IN_MS/4), CRLReason.affiliationChanged); + new Date(realNow.getTime() - ONE_HOUR_IN_MS/4), CRLReason.affiliationChanged); System.out.println("User certificate revoked at " + - new Date(new Date().getTime() - ONE_HOUR_IN_MS/4)); + new Date(realNow.getTime() - ONE_HOUR_IN_MS/4)); // create CRL X509CRL revokedCerts = test01_T_userCaCert.createCRL("SHA1withRSA", - new Date(new Date().getTime() - ONE_HOUR_IN_MS/60), // generated 1 min ago - new Date(new Date().getTime() + ONE_HOUR_IN_MS/2), // nextUpdate in 30 min + new Date(realNow.getTime() - ONE_HOUR_IN_MS/60), // generated 1 min ago + new Date(realNow.getTime() + ONE_HOUR_IN_MS/2), // nextUpdate in 30 min new BigInteger("4"), entries); @@ -917,14 +1162,14 @@ public void test01_T_ver4() throws Exception // revoke user certificate 45 min ago entries.addEntry(test01_T_userCert.getCertificate().getSerialNumber(), - new Date(new Date().getTime() - 1000*60*45), CRLReason.unspecified); + new Date(realNow.getTime() - 1000*60*45), CRLReason.unspecified); System.out.println("User certificate revoked at " + - new Date(new Date().getTime() - 1000*60*45)); + new Date(realNow.getTime() - 1000*60*45)); // create CRL X509CRL revokedCerts = test01_T_userCaCert.createCRL("SHA1withRSA", - new Date(new Date().getTime() - 1000*60), // generated 1 min ago - new Date(new Date().getTime() + 1000*60*30), // nextUpdate in 30 min + new Date(realNow.getTime() - 1000*60), // generated 1 min ago + new Date(realNow.getTime() + 1000*60*30), // nextUpdate in 30 min new BigInteger("4"), entries); @@ -974,13 +1219,15 @@ public void test01_T_ver4() throws Exception public void test02_X_sig1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test02_X_sig1.xml"); + removeFile(outFileName); SurrogateTimeStampTokenProvider.setTSACert(test02_X_tsa1Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20), + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 20), new BigInteger("1")); System.out.println("SignatureTimeStamp creation date is " - + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20)); + + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 20)); Document doc = getDocument("document.xml"); Element elemToSign = doc.getDocumentElement(); @@ -988,7 +1235,7 @@ public void test02_X_sig1() throws Exception signer.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); new Enveloped(signer.newSigner()).sign(elemToSign); - outputDocument(doc, "document.aged.test02_X_sig1.xml"); + outputDocument(doc, outFileName); } // extend T form to X form @@ -996,14 +1243,16 @@ public void test02_X_sig1() throws Exception public void test02_X_sig2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test02_X_sig2.xml"); + removeFile(outFileName); SurrogateTimeStampTokenProvider.setTSACert(test02_X_tsa2Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14), + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14), new BigInteger("2")); System.out.println("SigAndRefsTimeStamp creation date is " - + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14)); Document doc = getDocument("document.aged.test02_X_sig1.xml"); Element signatureNode = getSigElement(doc); @@ -1025,17 +1274,17 @@ public void test02_X_sig2() throws Exception // extend T to C XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, XAdESForm.C, - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14)); assertEquals(res.getSignatureForm(), XAdESForm.T); // extend C to X res = verifier.verify(signatureNode, null, formExt, XAdESForm.X, - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14)); assertEquals(res.getSignatureForm(), XAdESForm.C); - outputDocument(doc, "document.aged.test02_X_sig2.xml"); + outputDocument(doc, outFileName); } // extend X to X-L form @@ -1043,6 +1292,8 @@ public void test02_X_sig2() throws Exception public void test02_X_sig3() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test02_X_sig3.xml"); + removeFile(outFileName); Document doc = getDocument("document.aged.test02_X_sig2.xml"); Element signatureNode = getSigElement(doc); @@ -1060,7 +1311,7 @@ public void test02_X_sig3() throws Exception assertEquals(res.getSignatureForm(), XAdESForm.X); - outputDocument(doc, "document.aged.test02_X_sig3.xml"); + outputDocument(doc, outFileName); } // verify if the X form was properly created @@ -1078,7 +1329,7 @@ public void test02_X_ver1() throws Exception } // verify if the X-L form was properly created by using validators with just CA - // certificates, without CRLs or leaf certificates + // certificates and current CRLs for TSA @Test public void test02_X_ver2() throws Exception { @@ -1126,13 +1377,15 @@ public void test02_X_ver2() throws Exception public void test03_T_sig1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test03_T_sig1.xml"); + removeFile(outFileName); SurrogateTimeStampTokenProvider.setTSACert(test03_T_tsa1Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20), + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 20), new BigInteger("1")); System.out.println("SignatureTimeStamp creation date is " - + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 20)); + + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 20)); Document doc = getDocument("document.xml"); Element elemToSign = doc.getDocumentElement(); @@ -1140,7 +1393,7 @@ public void test03_T_sig1() throws Exception signer.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); new Enveloped(signer.newSigner()).sign(elemToSign); - outputDocument(doc, "document.aged.test03_T_sig1.xml"); + outputDocument(doc, outFileName); } // extend T form to X form @@ -1148,14 +1401,16 @@ public void test03_T_sig1() throws Exception public void test03_X_sig2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test03_X_sig2.xml"); + removeFile(outFileName); SurrogateTimeStampTokenProvider.setTSACert(test03_X_tsa2Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14), + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14), new BigInteger("2")); System.out.println("SigAndRefsTimeStamp creation date is " - + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14)); Document doc = getDocument("document.aged.test03_T_sig1.xml"); Element signatureNode = getSigElement(doc); @@ -1177,17 +1432,17 @@ public void test03_X_sig2() throws Exception // extend T to C XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, XAdESForm.C, - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14)); assertEquals(res.getSignatureForm(), XAdESForm.T); // extend C to X res = verifier.verify(signatureNode, null, formExt, XAdESForm.X, - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14)); assertEquals(res.getSignatureForm(), XAdESForm.C); - outputDocument(doc, "document.aged.test03_X_sig2.xml"); + outputDocument(doc, outFileName); } // extend X to X-L form @@ -1195,6 +1450,8 @@ public void test03_X_sig2() throws Exception public void test03_X_sig3() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test03_X_sig3.xml"); + removeFile(outFileName); Document doc = getDocument("document.aged.test03_X_sig2.xml"); Element signatureNode = getSigElement(doc); @@ -1208,11 +1465,11 @@ public void test03_X_sig3() throws Exception // extend X to X-L XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, - XAdESForm.X_L, new Date(new Date().getTime() - 10 * ONE_HOUR_IN_MS)); + XAdESForm.X_L, new Date(realNow.getTime() - 10 * ONE_HOUR_IN_MS)); assertEquals(res.getSignatureForm(), XAdESForm.X); - outputDocument(doc, "document.aged.test03_X_sig3.xml"); + outputDocument(doc, outFileName); } // extend X-L form to A form @@ -1220,14 +1477,16 @@ public void test03_X_sig3() throws Exception public void test03_A_sig4() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test03_A_sig4.xml"); + removeFile(outFileName); SurrogateTimeStampTokenProvider.setTSACert(test03_A_tsa3Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 10), + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 10), new BigInteger("2")); System.out.println("ArchiveTimeStamp creation date is " - + new Date(new Date().getTime() - ONE_HOUR_IN_MS * 10)); + + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 10)); Document doc = getDocument("document.aged.test03_X_sig3.xml"); Element signatureNode = getSigElement(doc); @@ -1249,11 +1508,11 @@ public void test03_A_sig4() throws Exception // extend X-L to A XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, XAdESForm.A, - new Date(new Date().getTime() - ONE_HOUR_IN_MS * 14)); + new Date(realNow.getTime() - ONE_HOUR_IN_MS * 14)); assertEquals(res.getSignatureForm(), XAdESForm.X_L); - outputDocument(doc, "document.aged.test03_A_sig4.xml"); + outputDocument(doc, outFileName); } // verify A form @@ -1275,6 +1534,8 @@ public void test03_A_ver1() throws Exception public void test03_A_sig5() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test03_A_sig5.xml"); + removeFile(outFileName); Document doc = getDocument("document.aged.test03_A_sig4.xml"); Element signatureNode = getSigElement(doc); @@ -1293,7 +1554,7 @@ public void test03_A_sig5() throws Exception assertEquals(res.getSignatureForm(), XAdESForm.A); - outputDocument(doc, "document.aged.test03_A_sig5.xml"); + outputDocument(doc, outFileName); } // verify A form using minimal validators @@ -1315,14 +1576,16 @@ public void test03_A_ver2() throws Exception public void test03_A_sig6() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); + String outFileName = new String("document.aged.test03_A_sig6.xml"); + removeFile(outFileName); SurrogateTimeStampTokenProvider.setTSACert(test03_A_tsa3Cert); SurrogateTimeStampTokenProvider.setTimeAndSerial( - new Date(), + realNow, new BigInteger("3")); System.out.println("ArchiveTimeStamp creation date is " - + new Date()); + + realNow); Document doc = getDocument("document.aged.test03_A_sig5.xml"); Element signatureNode = getSigElement(doc); @@ -1341,146 +1604,1550 @@ public void test03_A_sig6() throws Exception assertEquals(res.getSignatureForm(), XAdESForm.A); - outputDocument(doc, "document.aged.test03_A_sig6.xml"); + outputDocument(doc, outFileName); } - /* - * TODO missing grace period support - * The library should support enforcing grace period, but what's more important, it - * should add only necessary CRLs when creating revocation information related - * properties. If that's not performed, then CRLs that don't help in later - * validation will be added causing the file size to grow needlessly. - - time - . - | <- Signature creation time - | - | <- SignatureTimeStamp creation time (XAdES-T) - | + - | | - | | grace period for Signature - | | - | + - | <- earliest time a CRL will make the Signature non-repudiable - | - | <- publishing of CRL for Signature certificate - | <- earliest time a usable XAdES-C can be created - / - / - | <- SigAndRefsTimeStamp creation time (XAdES-X) - | + - | | - | | grace period for SignatureTimeStamp - | | - | + - | <- earliest time a CRL will make SignatureTimeStamp non-repudiable - | - | <- publishing of CRL for SignatureTimeStamp certificate - | <- earliest time a usable XAdES-X-L can be created - / - / - | <- 1st ArchiveTimeStamp creation time (XAdES-A) - | + - | | - | | grace period for SigAndRefsTimeSamp - | | - | + - | <- earliest time a CRL will make SigAndRefsTimeStamp non-repudiable - | - | <- publishing of CRL for SigAndRefsTimeStamp - | <- earliest time TimeStampValidationData can be created (XAdES-A-VD) - / - / - | <- 2nd ArchiveTimeStamp creation time (XAdES-A) - | + - | | - | | grace period for 1st ArchiveTimeStamp - | | - | + - | <- earliest time a CRL will make 1st ArchiveTimeStamp non-repudiable - | - | <- publishing of CRL for 1st ArchiveTimeStamp - | <- earliest time TimeStampValidationData for 1st ArchiveTimeStamp can be created - ' - - */ - /* - * end of tests + /* Tests with multiple Time Stamping Authorities and realistic time periods + * + * quick overview: + * t + * -17y -- Signature creation + * -17y ̣ -- XAdES-T form creation (2 time stamps) (consterTSA and ascendeusTSA) + * -17y+16d-- XAdES-C form creation + * -13y -- XAdES-X form creation (2 time stamps) (ascendeusTSA and carpamaTSA) + * -13y+2w -- XAdES-X-L form creation + * -9y -- XAdES-A form creation (2 time stamps, 1st set) (carpamaTSA and premoxTSA) + * -9y+2w -- XAdES-A with validation data + * -5y -- extending XAdES-A with new set of timestamps (2 timestamps, 2nd set) (premoxTSA and gescapeTSA) + * -5y+2w -- adding validation data + * -1y -- extending XAdES-A with new set of timestamps (2 timestamps, 3rd set) (unibimTSA and astronTSA) + * -1y+2w -- adding validation data + * now -- validation with currently available revocation data + * + * Certificate authorities hierarchy: + * + * ACME Certification Services CA + * | + * + Will E. Coyote + * + * Conster CA + * | + * + Conster Time Server (5 years) + * + * Ascendeus Root CA (10 years) + * | + * + Ascendeus Issuing CA (8 years) + * | + * + Ascendeus Time Services (5 years) + * | + * + Ascendeus Time Services (2nd) (5 years) + * + * Carpama Certificate Authority (10 years) + * | + * + Carpama Time Server (5 years) + * | + * + Carpama Time Server (2nd) (5 years) + * + * Premox CA (10 years) + * | + * + Premox TSA (5 years) + * | + * + Premox TSA (2nd) (5 years) + * + * Gescape CA (10 years) + * | + * + Gescape TSA (5 years) + * + * Unibim CA (10 years) + * | + * + Unibim TSA (5 years) + * + * Astron CA (10 years) + * | + * + Astron TSA (5 years) */ - // helper method - private XAdESForm verifySignature(String path, - XadesVerificationProfile p) - throws FileNotFoundException, ParserConfigurationException, - SAXException, IOException, XadesProfileResolutionException, XAdES4jException + // create XAdES-T form + @Test + public void test04_T_sig1() throws Exception { - Element signatureNode = getSigElement(getDocument(path)); - XAdESVerificationResult res = p.newVerifier().verify(signatureNode, null); - return res.getSignatureForm(); - } + System.out.println("test04_T_sig1"); - // helper method - private Element getSigElement(Document document) - { - return (Element)document.getElementsByTagNameNS(Constants.SignatureSpecNS, - Constants._TAG_SIGNATURE).item(0); - } + Date now = new Date(realNow.getTime() - 17 * ONE_YEAR_IN_MS); - // helper method - private void outputDocument(Document doc, String path) - throws TransformerConfigurationException, - TransformerException, IOException - { - path = toDocumentDirFilePath(path); - TransformerFactory tf = TransformerFactory.newInstance(); - FileOutputStream out = new FileOutputStream(path); - tf.newTransformer().transform( - new DOMSource(doc), - new StreamResult(out)); - out.flush(); - out.getFD().sync(); - out.close(); - } + KeyingDataProvider keyingDataProvider = new DirectKeyingDataProvider( + test04_willECoyote.getCertificate(), + test04_willECoyote.getPrivateKey()); - // helper method - private static void saveCRL(String path, X509CRL crl) - throws CRLException, IOException - { - path = "./src/test/cert/aged/" + path; - FileOutputStream fos = new FileOutputStream(path); - fos.write(crl.getEncoded()); - fos.close(); - return; - } + SurrogateTimeStampTokenProvider.setTSACert(test04_consterTSA17ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("3")); - // helper method - private String toDocumentDirFilePath(String path) - { - return "./src/test/xml/" + path; - } + Document doc = getDocument("document.xml"); + Element elemToSign = doc.getDocumentElement(); + XadesSigningProfile signer = new XadesTSigningProfile(keyingDataProvider); + signer.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + new Enveloped(signer.newSigner()).sign(elemToSign); - // helper method - private static void saveCertificate(String path, X509Certificate cert) - throws CertificateEncodingException, IOException - { - path = "./src/test/cert/aged/" + path; - FileOutputStream fos = new FileOutputStream(path); - fos.write(cert.getEncoded()); - fos.close(); - return; + outputDocument(doc, "document.aged.test04.T.xml"); } - // helper method - private Document getDocument(String path) throws ParserConfigurationException, - FileNotFoundException, SAXException, IOException + // add second XAdES-T time stamp + @Test + public void test04_T_sig2() throws Exception { - path = toDocumentDirFilePath(path); - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - DocumentBuilder db = dbf.newDocumentBuilder(); - Document doc = db.parse(new FileInputStream(path)); + System.out.println("test04_T_sig2"); + + Date now = new Date(realNow.getTime() - 17 * ONE_YEAR_IN_MS + + 2 * ONE_HOUR_IN_MS); + + SurrogateTimeStampTokenProvider.setTSACert(test04_ascendeusTSA17ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("34")); + + Document doc = getDocument("document.aged.test04.T.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore trustAnchors = keyStoreForCerts(test04_acmeCA); + final CRLEntries emptyEntries = test04_acmeCA.new CRLEntries(); + X509CRL acmeCRL = test04_acmeCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 6 * ONE_DAY_IN_MS), + new Date(now.getTime() + ONE_DAY_IN_MS), + new BigInteger("2"), + emptyEntries); + X509CRL acmePcCRL = test04_acmePersonalCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("2"), + emptyEntries); + Collection crls = createCRLCollection(acmeCRL, acmePcCRL); + CertStore intermCertsAndCrls = certStoreForCertsAndCrls( + crls, + test04_acmeCA.getCertificate(), + test04_acmePersonalCA.getCertificate(), + test04_willECoyote.getCertificate()); + CertificateValidationProvider certValidationDataProvider = + new PKIXCertificateValidationProvider(trustAnchors, + true, + intermCertsAndCrls); + + KeyStore tsaTrustAnchors = keyStoreForCerts(test04_consterCA); + X509CRL consterCRL = test04_consterCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("2"), + emptyEntries); + X509CRL ascendusCRL = test04_ascendeusCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("2"), + emptyEntries); + X509CRL ascendusIssuingCRL = test04_ascendeusIssuingCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 18 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 6 * ONE_HOUR_IN_MS), + new BigInteger("2"), + emptyEntries); + Collection tsaCRLs = createCRLCollection(consterCRL, + ascendusCRL, + ascendusIssuingCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls( + tsaCRLs, + test04_consterCA.getCertificate(), + test04_consterTSA17ya.getCertificate(), + test04_ascendeusCA.getCertificate(), + test04_ascendeusIssuingCA.getCertificate(), + test04_ascendeusTSA17ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + certValidationDataProvider, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + // add second T time stamp + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.T, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.T); + + outputDocument(doc, "document.aged.test04.T2.xml"); + } + + // add references to signature data + @Test + public void test04_C_sig3() throws Exception + { + System.out.println("test04_C_sig3"); + + final Date now = new Date(realNow.getTime() - 17 * ONE_YEAR_IN_MS + + 16 * ONE_DAY_IN_MS); + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.T2.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_ascendeusCA, + test04_consterCA); + X509CRL ascendeusCRL = test04_ascendeusCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 1 * ONE_DAY_IN_MS), + new Date(now.getTime() + 6 * ONE_DAY_IN_MS), + new BigInteger("3"), + emptyEntries); + X509CRL ascendeusIssuingCRL = test04_ascendeusIssuingCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("3"), + emptyEntries); + X509CRL consterCRL = test04_consterCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 20 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 1 * ONE_HOUR_IN_MS), + new BigInteger("3"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + ascendeusCRL, + ascendeusIssuingCRL, + consterCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_ascendeusCA.getCertificate(), + test04_ascendeusIssuingCA.getCertificate(), + test04_ascendeusTSA17ya.getCertificate(), + test04_consterCA.getCertificate(), + test04_consterTSA17ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + // it shouldn't be used now, as it is not configured, it will throw an exception + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderCCreation, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.C, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.T); + + outputDocument(doc, "document.aged.test04_C.xml"); + } + + // add second type of time stamp to signature (SigAndRefsTimeStamp) + @Test + public void test04_X_sig4() throws Exception + { + System.out.println("test04_X_sig4"); + Date now = new Date(realNow.getTime() - 13 * ONE_YEAR_IN_MS); + SurrogateTimeStampTokenProvider.setTSACert(test04_ascendeusTSA13ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("35")); + + Document doc = getDocument("document.aged.test04_C.xml"); + Element signatureNode = getSigElement(doc); + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA); + + final CRLEntries emptyEntries = test04_consterCA.new CRLEntries(); + X509CRL consterCRL = test04_consterCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 7 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 17 * ONE_HOUR_IN_MS), + new BigInteger("4"), + emptyEntries ); + X509CRL ascendeusCRL = test04_ascendeusCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("4"), + emptyEntries); + X509CRL ascendeusIssuingCRL = test04_ascendeusIssuingCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("4"), + emptyEntries); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 4 * ONE_HOUR_IN_MS), + new BigInteger("4"), + emptyEntries); + Collection tsaCRLs =createCRLCollection( + consterCRL, + ascendeusCRL, + ascendeusIssuingCRL, + carpamaCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_consterCA.getCertificate(), + test04_consterTSA17ya.getCertificate(), + test04_ascendeusCA.getCertificate(), + test04_ascendeusIssuingCA.getCertificate(), + test04_ascendeusTSA17ya.getCertificate(), + test04_ascendeusTSA13ya.getCertificate(), + test04_carpamaCA.getCertificate(), + test04_carpamaTSA13ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider( + tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderCCreation, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.X, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.C); + + outputDocument(doc, "document.aged.test04.X.xml"); + } + + // add second SigAndRefsTimeStamp + @Test + public void test04_X_sig5() throws Exception + { + System.out.println("test04_X_sig4"); + Date now = new Date(realNow.getTime() - 13 * ONE_YEAR_IN_MS + ONE_HOUR_IN_MS / 2); + SurrogateTimeStampTokenProvider.setTSACert(test04_carpamaTSA13ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("36")); + + Document doc = getDocument("document.aged.test04.X.xml"); + Element signatureNode = getSigElement(doc); + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA); + + final CRLEntries emptyEntries = test04_consterCA.new CRLEntries(); + X509CRL consterCRL = test04_consterCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 7 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 17 * ONE_HOUR_IN_MS), + new BigInteger("5"), + emptyEntries ); + X509CRL ascendeusCRL = test04_ascendeusCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("5"), + emptyEntries); + X509CRL ascendeusIssuingCRL = test04_ascendeusIssuingCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("5"), + emptyEntries); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 4 * ONE_HOUR_IN_MS), + new BigInteger("5"), + emptyEntries); + Collection tsaCRLs =createCRLCollection( + consterCRL, + ascendeusCRL, + ascendeusIssuingCRL, + carpamaCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_consterCA.getCertificate(), + test04_consterTSA17ya.getCertificate(), + test04_ascendeusCA.getCertificate(), + test04_ascendeusIssuingCA.getCertificate(), + test04_ascendeusTSA17ya.getCertificate(), + test04_ascendeusTSA13ya.getCertificate(), + test04_carpamaCA.getCertificate(), + test04_carpamaTSA13ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider( + tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderCCreation, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.X, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.X); + + outputDocument(doc, "document.aged.test04.X2.xml"); + } + + // add certificates to signature (X-L form) + @Test + public void test04_XL_sig6() throws Exception + { + System.out.println("test04_XL_sig6"); + + final Date now = new Date(realNow.getTime() - 13 * ONE_YEAR_IN_MS + + 14 * ONE_DAY_IN_MS); + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.X2.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_ascendeusCA, + test04_consterCA, + test04_carpamaCA); + X509CRL ascendeusCRL = test04_ascendeusCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 1 * ONE_DAY_IN_MS), + new Date(now.getTime() + 6 * ONE_DAY_IN_MS), + new BigInteger("6"), + emptyEntries); + X509CRL ascendeusIssuingCRL = test04_ascendeusIssuingCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("6"), + emptyEntries); + X509CRL consterCRL = test04_consterCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 20 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 1 * ONE_HOUR_IN_MS), + new BigInteger("6"), + emptyEntries); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 20 * ONE_HOUR_IN_MS), + new BigInteger("6"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + ascendeusCRL, + ascendeusIssuingCRL, + consterCRL, + carpamaCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_ascendeusCA.getCertificate(), + test04_ascendeusIssuingCA.getCertificate(), + test04_ascendeusTSA17ya.getCertificate(), + test04_ascendeusTSA13ya.getCertificate(), + test04_consterCA.getCertificate(), + test04_consterTSA17ya.getCertificate(), + test04_carpamaCA.getCertificate(), + test04_carpamaTSA13ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + // it shouldn't be used now, as it is not configured, it will throw an exception + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderCCreation, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.X_L, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.X); + + outputDocument(doc, "document.aged.test04.XL.xml"); + } + + // add first Archival Time Stamp + @Test + public void test04_A_sig7() throws Exception + { + System.out.println("test04_A_sig7"); + Date now = new Date(realNow.getTime() - 9 * ONE_YEAR_IN_MS); + SurrogateTimeStampTokenProvider.setTSACert(test04_carpamaTSA9ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("37")); + + Document doc = getDocument("document.aged.test04.XL.xml"); + Element signatureNode = getSigElement(doc); + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA); + + final CRLEntries emptyEntries = test04_consterCA.new CRLEntries(); + X509CRL ascendeusCRL = test04_ascendeusCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("7"), + emptyEntries); + X509CRL ascendeusIssuingCRL = test04_ascendeusIssuingCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("7"), + emptyEntries); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 4 * ONE_HOUR_IN_MS), + new BigInteger("7"), + emptyEntries); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("7"), + emptyEntries); + Collection tsaCRLs =createCRLCollection( + ascendeusCRL, + ascendeusIssuingCRL, + carpamaCRL, + premoxCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_ascendeusCA.getCertificate(), + test04_ascendeusIssuingCA.getCertificate(), + test04_ascendeusTSA13ya.getCertificate(), + test04_carpamaCA.getCertificate(), + test04_carpamaTSA13ya.getCertificate(), + test04_carpamaTSA9ya.getCertificate(), + test04_premoxCA.getCertificate(), + test04_premoxTSA9ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider( + tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.X_L); + + outputDocument(doc, "document.aged.test04.A.xml"); + } + + // add second Archival time stamp + @Test + public void test04_A_sig8() throws Exception + { + System.out.println("test04_A_sig8"); + Date now = new Date(realNow.getTime() - 9 * ONE_YEAR_IN_MS + ONE_HOUR_IN_MS / 60); + SurrogateTimeStampTokenProvider.setTSACert(test04_premoxTSA9ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial( + now, + new BigInteger("38")); + + Document doc = getDocument("document.aged.test04.A.xml"); + Element signatureNode = getSigElement(doc); + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA); + + final CRLEntries emptyEntries = test04_consterCA.new CRLEntries(); + X509CRL ascendeusCRL = test04_ascendeusCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("8"), + emptyEntries); + X509CRL ascendeusIssuingCRL = test04_ascendeusIssuingCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("8"), + emptyEntries); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 4 * ONE_HOUR_IN_MS), + new BigInteger("8"), + emptyEntries); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("8"), + emptyEntries); + Collection tsaCRLs =createCRLCollection( + ascendeusCRL, + ascendeusIssuingCRL, + carpamaCRL, + premoxCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_ascendeusCA.getCertificate(), + test04_ascendeusIssuingCA.getCertificate(), + test04_ascendeusTSA13ya.getCertificate(), + test04_carpamaCA.getCertificate(), + test04_carpamaTSA13ya.getCertificate(), + test04_carpamaTSA9ya.getCertificate(), + test04_premoxCA.getCertificate(), + test04_premoxTSA9ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider( + tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A, + now); + + assertEquals(XAdESForm.A, res.getSignatureForm()); + + outputDocument(doc, "document.aged.test04.A2.xml"); + } + + @Test + public void test04_AVD_sig9() throws Exception + { + System.out.println("test04_AVD_sig9"); + + final Date now = new Date(realNow.getTime() - 9 * ONE_YEAR_IN_MS + + 14 * ONE_DAY_IN_MS); + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.A2.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA); + X509CRL ascendeusCRL = test04_ascendeusCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 1 * ONE_DAY_IN_MS), + new Date(now.getTime() + 6 * ONE_DAY_IN_MS), + new BigInteger("9"), + emptyEntries); + X509CRL ascendeusIssuingCRL = test04_ascendeusIssuingCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("9"), + emptyEntries); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 20 * ONE_HOUR_IN_MS), + new BigInteger("9"), + emptyEntries); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("9"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + ascendeusCRL, + ascendeusIssuingCRL, + premoxCRL, + carpamaCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_ascendeusCA.getCertificate(), + test04_ascendeusIssuingCA.getCertificate(), + test04_ascendeusTSA13ya.getCertificate(), + test04_carpamaCA.getCertificate(), + test04_carpamaTSA13ya.getCertificate(), + test04_carpamaTSA9ya.getCertificate(), + test04_premoxCA.getCertificate(), + test04_premoxTSA9ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + // it shouldn't be used now, as it is not configured, it will throw an exception + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A_VD, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test04.AVD.xml"); + } + + // add second group of A time stamps + @Test + public void test04_2A_sig10() throws Exception + { + System.out.println("test04_2A_sig10"); + Date now = new Date(realNow.getTime() - 5 * ONE_YEAR_IN_MS); + SurrogateTimeStampTokenProvider.setTSACert(test04_premoxTSA5ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("38")); + + Document doc = getDocument("document.aged.test04.AVD.xml"); + Element signatureNode = getSigElement(doc); + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA, + test04_gescapeCA); + + final CRLEntries emptyEntries = test04_consterCA.new CRLEntries(); + X509CRL gescapeCRL = test04_gescapeCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("10"), + emptyEntries); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 4 * ONE_HOUR_IN_MS), + new BigInteger("10"), + emptyEntries); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("10"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + carpamaCRL, + premoxCRL, + gescapeCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_gescapeCA.getCertificate(), + test04_gescapeTSA5ya.getCertificate(), + test04_carpamaCA.getCertificate(), + test04_carpamaTSA9ya.getCertificate(), + test04_premoxCA.getCertificate(), + test04_premoxTSA9ya.getCertificate(), + test04_premoxTSA5ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider( + tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test04.2A.xml"); + } + + // add second time stamp in second group of timestamps + @Test + public void test04_2A_sig11() throws Exception + { + System.out.println("test04_2A_sig11"); + Date now = new Date(realNow.getTime() - 5 * ONE_YEAR_IN_MS + ONE_HOUR_IN_MS); + SurrogateTimeStampTokenProvider.setTSACert(test04_gescapeTSA5ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("39")); + + Document doc = getDocument("document.aged.test04.2A.xml"); + Element signatureNode = getSigElement(doc); + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA, + test04_gescapeCA); + + final CRLEntries emptyEntries = test04_consterCA.new CRLEntries(); + X509CRL gescapeCRL = test04_gescapeCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("11"), + emptyEntries); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 4 * ONE_HOUR_IN_MS), + new BigInteger("11"), + emptyEntries); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("11"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + carpamaCRL, + premoxCRL, + gescapeCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_gescapeCA.getCertificate(), + test04_gescapeTSA5ya.getCertificate(), + test04_carpamaCA.getCertificate(), + test04_carpamaTSA9ya.getCertificate(), + test04_premoxCA.getCertificate(), + test04_premoxTSA9ya.getCertificate(), + test04_premoxTSA5ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider( + tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test04.2A2.xml"); + } + + // add revocation information about first group of archive time stamps + @Test + public void test04_2AVD_sig12() throws Exception + { + System.out.println("test04_2AVD_sig12"); + + final Date now = new Date(realNow.getTime() - 5 * ONE_YEAR_IN_MS + + 14 * ONE_DAY_IN_MS); + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.2A2.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA, + test04_gescapeCA); + X509CRL carpamaCRL = test04_carpamaCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 4 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 20 * ONE_HOUR_IN_MS), + new BigInteger("12"), + emptyEntries); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("12"), + emptyEntries); + X509CRL gescapeCRL = test04_gescapeCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("12"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + premoxCRL, + carpamaCRL, + gescapeCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_carpamaCA.getCertificate(), + test04_carpamaTSA9ya.getCertificate(), + test04_premoxCA.getCertificate(), + test04_premoxTSA9ya.getCertificate(), + test04_gescapeCA.getCertificate(), + test04_gescapeTSA5ya.getCertificate(), + test04_premoxTSA5ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + // it shouldn't be used now, as it is not configured, it will throw an exception + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A_VD, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test04.2AVD.xml"); + } + + // add first timestamp to third group of timestamps + @Test + public void test04_3A_sig13() throws Exception + { + System.out.println("test04_3A_sig13"); + Date now = new Date(realNow.getTime() - 1 * ONE_YEAR_IN_MS); + SurrogateTimeStampTokenProvider.setTSACert(test04_unibimTSA1ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("39")); + + Document doc = getDocument("document.aged.test04.2AVD.xml"); + Element signatureNode = getSigElement(doc); + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA, + test04_gescapeCA, + test04_unibimCA); + + final CRLEntries emptyEntries = test04_consterCA.new CRLEntries(); + X509CRL gescapeCRL = test04_gescapeCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("13"), + emptyEntries); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("13"), + emptyEntries); + X509CRL unibimCRL = test04_unibimCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("13"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + premoxCRL, + gescapeCRL, + unibimCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_gescapeCA.getCertificate(), + test04_gescapeTSA5ya.getCertificate(), + test04_premoxCA.getCertificate(), + test04_premoxTSA5ya.getCertificate(), + test04_unibimCA.getCertificate(), + test04_unibimTSA1ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider( + tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test04.3A.xml"); + } + + // add second timestamp to third group of timestamps + @Test + public void test04_3A_sig14() throws Exception + { + System.out.println("test04_3A_sig14"); + Date now = new Date(realNow.getTime() - 1 * ONE_YEAR_IN_MS + ONE_HOUR_IN_MS); + SurrogateTimeStampTokenProvider.setTSACert(test04_astronTSA1ya); + SurrogateTimeStampTokenProvider.setTimeAndSerial(now, new BigInteger("40")); + + Document doc = getDocument("document.aged.test04.3A.xml"); + Element signatureNode = getSigElement(doc); + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA, + test04_gescapeCA, + test04_unibimCA, + test04_astronCA); + + final CRLEntries emptyEntries = test04_consterCA.new CRLEntries(); + X509CRL gescapeCRL = test04_gescapeCA.createCRL( + "SHA1withRSA", + new Date(now.getTime() - 2 * ONE_DAY_IN_MS), + new Date(now.getTime() + 5 * ONE_DAY_IN_MS), + new BigInteger("14"), + emptyEntries); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + X509CRL unibimCRL = test04_unibimCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + X509CRL astronCRL = test04_astronCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + premoxCRL, + gescapeCRL, + unibimCRL, + astronCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_gescapeCA.getCertificate(), + test04_gescapeTSA5ya.getCertificate(), + test04_premoxCA.getCertificate(), + test04_premoxTSA5ya.getCertificate(), + test04_unibimCA.getCertificate(), + test04_unibimTSA1ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider( + tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test04.3A2.xml"); + } + + // add revocation information about second group of archive time stamps + @Test + public void test04_3AVD_sig15() throws Exception + { + System.out.println("test04_3AVD_sig14"); + + final Date now = new Date(realNow.getTime() - 1 * ONE_YEAR_IN_MS + + 14 * ONE_DAY_IN_MS); + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.3A2.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA, + test04_gescapeCA, + test04_unibimCA, + test04_astronCA); + X509CRL premoxCRL = test04_premoxCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + X509CRL gescapeCRL = test04_gescapeCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + X509CRL unibimCRL = test04_unibimCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + X509CRL astronCRL = test04_astronCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + premoxCRL, + gescapeCRL, + unibimCRL, + astronCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_premoxCA.getCertificate(), + test04_premoxTSA5ya.getCertificate(), + test04_gescapeCA.getCertificate(), + test04_gescapeTSA5ya.getCertificate(), + test04_unibimCA.getCertificate(), + test04_unibimTSA1ya.getCertificate(), + test04_astronCA.getCertificate(), + test04_astronTSA1ya.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesFormatExtenderProfile formExtProfile = new XadesFormatExtenderProfile(); + // it shouldn't be used now, as it is not configured, it will throw an exception + formExtProfile.withTimeStampTokenProvider(SurrogateTimeStampTokenProvider.class); + XadesSignatureFormatExtender formExt = formExtProfile.getFormatExtender(); + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null, formExt, + XAdESForm.A_VD, + now); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + + outputDocument(doc, "document.aged.test04.3AVD.xml"); + } + + // test with minimal revocation information and all trust anchors + @Test + public void test04_3AVD_ver1() throws Exception + { + System.out.println("test04_3AVD_ver1"); + + final Date now = realNow; + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.3AVD.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_ascendeusCA, + test04_carpamaCA, + test04_premoxCA, + test04_gescapeCA, + test04_unibimCA, + test04_astronCA); + X509CRL unibimCRL = test04_unibimCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + X509CRL astronCRL = test04_astronCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + unibimCRL, + astronCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_unibimCA.getCertificate(), + test04_astronCA.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + } + + // test with minimal revocation information and only some TSA trust anchors (minimal amount + // that will still allow for successful history traversal) + @Test + public void test04_3AVD_ver2() throws Exception + { + System.out.println("test04_3AVD_ver2"); + + final Date now = realNow; + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.3AVD.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_carpamaCA, + test04_gescapeCA, + test04_astronCA); + X509CRL astronCRL = test04_astronCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + astronCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_astronCA.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + } + + // test with minimal revocation information and only some TSA trust anchors + // removal of trust for all newest TSAs (gescape TSA is valid but don't provide CRL + // for it) + @Test(expected = CannotBuildCertificationPathException.class) + public void test04_3AVD_ver3() throws Exception + { + System.out.println("test04_3AVD_ver3"); + + final Date now = realNow; + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.3AVD.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_carpamaCA, + test04_gescapeCA); + X509CRL astronCRL = test04_astronCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + astronCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_astronCA.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + } + + // test with minimal revocation information and only some TSA trust anchors + // removal of trust for all newest TSAs, but provide CRL for gescape + @Test + public void test04_3AVD_ver4() throws Exception + { + System.out.println("test04_3AVD_ver3"); + + final Date now = realNow; + final CRLEntries emptyEntries = test04_ascendeusCA.new CRLEntries(); + + Document doc = getDocument("document.aged.test04.3AVD.xml"); + Element signatureNode = getSigElement(doc); + + KeyStore tsaTrustAnchors = keyStoreForCerts( + test04_consterCA, + test04_carpamaCA, + test04_gescapeCA); + X509CRL gescapeCRL = test04_gescapeCA.createCRL( + "SHA256withRSA", + new Date(now.getTime() - 12 * ONE_HOUR_IN_MS), + new Date(now.getTime() + 12 * ONE_HOUR_IN_MS), + new BigInteger("14"), + emptyEntries); + Collection tsaCRLs = createCRLCollection( + gescapeCRL); + CertStore tsaIntermCertsAndCrls = certStoreForCertsAndCrls(tsaCRLs, + test04_gescapeCA.getCertificate()); + TSACertificateValidationProvider tsaValidationDataProvider = + new PKIXTSACertificateValidationProvider(tsaTrustAnchors, + true, + tsaIntermCertsAndCrls); + + XadesVerificationProfile verProfile = new XadesVerificationProfile( + test04_certValidationDataProviderOnlyTrustAnchors, + tsaValidationDataProvider); + + XadesHybridVerifierImpl verifier = (XadesHybridVerifierImpl) verProfile.newVerifier(); + + XAdESVerificationResult res = verifier.verify(signatureNode, null); + + assertEquals(res.getSignatureForm(), XAdESForm.A); + } + + /* + * TODO missing grace period support + * The library should support enforcing grace period, but what's more important, it + * should add only necessary CRLs when creating revocation information related + * properties. If that's not performed, then CRLs that don't help in later + * validation will be added causing the file size to grow needlessly. + + time + . + | <- Signature creation time + | + | <- SignatureTimeStamp creation time (XAdES-T) + | + + | | + | | grace period for Signature + | | + | + + | <- earliest time a CRL will make the Signature non-repudiable + | + | <- publishing of CRL for Signature certificate + | <- earliest time a usable XAdES-C can be created + / + / + | <- SigAndRefsTimeStamp creation time (XAdES-X) + | + + | | + | | grace period for SignatureTimeStamp + | | + | + + | <- earliest time a CRL will make SignatureTimeStamp non-repudiable + | + | <- publishing of CRL for SignatureTimeStamp certificate + | <- earliest time a usable XAdES-X-L can be created + / + / + | <- 1st ArchiveTimeStamp creation time (XAdES-A) + | + + | | + | | grace period for SigAndRefsTimeSamp + | | + | + + | <- earliest time a CRL will make SigAndRefsTimeStamp non-repudiable + | + | <- publishing of CRL for SigAndRefsTimeStamp + | <- earliest time TimeStampValidationData can be created (XAdES-A-VD) + / + / + | <- 2nd ArchiveTimeStamp creation time (XAdES-A) + | + + | | + | | grace period for 1st ArchiveTimeStamp + | | + | + + | <- earliest time a CRL will make 1st ArchiveTimeStamp non-repudiable + | + | <- publishing of CRL for 1st ArchiveTimeStamp + | <- earliest time TimeStampValidationData for 1st ArchiveTimeStamp can be created + ' + + */ + /* + * end of tests + */ + + // helper method + private XAdESForm verifySignature(String path, + XadesVerificationProfile p) + throws FileNotFoundException, ParserConfigurationException, + SAXException, IOException, XadesProfileResolutionException, XAdES4jException + { + Element signatureNode = getSigElement(getDocument(path)); + XAdESVerificationResult res = p.newVerifier().verify(signatureNode, null); + return res.getSignatureForm(); + } + + // helper method + private Element getSigElement(Document document) + { + return (Element)document.getElementsByTagNameNS(Constants.SignatureSpecNS, + Constants._TAG_SIGNATURE).item(0); + } + + private void removeFile(String path) + { + path = toDocumentDirFilePath(path); + File file = new File(path); + file.delete(); + } + + // helper method + private void outputDocument(Document doc, String path) + throws TransformerConfigurationException, + TransformerException, IOException + { + path = toDocumentDirFilePath(path); + TransformerFactory tf = TransformerFactory.newInstance(); + FileOutputStream out = new FileOutputStream(path); + tf.newTransformer().transform( + new DOMSource(doc), + new StreamResult(out)); + out.flush(); + out.getFD().sync(); + out.close(); + } + + // helper method + private static void saveCRL(String path, X509CRL crl) + throws CRLException, IOException + { + path = "./src/test/cert/aged/" + path; + FileOutputStream fos = new FileOutputStream(path); + fos.write(crl.getEncoded()); + fos.close(); + return; + } + + // helper method + private String toDocumentDirFilePath(String path) + { + return "./src/test/xml/" + path; + } + + // helper method + private static void saveCertificate(String path, X509Certificate cert) + throws CertificateEncodingException, IOException + { + path = "./src/test/cert/aged/" + path; + FileOutputStream fos = new FileOutputStream(path); + fos.write(cert.getEncoded()); + fos.close(); + return; + } + + // helper method + private Document getDocument(String path) throws ParserConfigurationException, + FileNotFoundException, SAXException, IOException + { + path = toDocumentDirFilePath(path); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document doc = db.parse(new FileInputStream(path)); Element elem = doc.getDocumentElement(); DOMHelper.useIdAsXmlId(elem); return doc; } + + private static Collection createCRLCollection(X509CRL... crls) + { + Collection list = new ArrayList(crls.length); + for (X509CRL c : crls) + { + list.add(c); + } + return list; + } + + private static CertStore certStoreForCertsAndCrls(Collection crls, + X509Certificate... certificates) + throws InvalidAlgorithmParameterException, NoSuchAlgorithmException + { + Collection certs = new ArrayList(crls.size() + certificates.length); + for (X509Certificate cert : certificates) + { + certs.add(cert); + } + certs.addAll(crls); + CertStore certStore = CertStore.getInstance( + "Collection", + new CollectionCertStoreParameters(certs)); + return certStore; + } + + private static KeyStore keyStoreForCerts(FullCert... certs) throws KeyStoreException, + IOException, NoSuchAlgorithmException, CertificateException + { + KeyStore trustAnchors = KeyStore.getInstance(KeyStore.getDefaultType()); + trustAnchors.load(null); + int i = 1; + for(FullCert cert: certs) + { + Entry entry = new TrustedCertificateEntry(cert.getCertificate()); + trustAnchors.setEntry("ca" + i, entry , null); + i++; + } + return trustAnchors; + } } From 63d29c094616ad20354f1a869d94c16e8802b5ed Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 24 Dec 2012 23:42:45 +0100 Subject: [PATCH 66/84] fix variable names in PropertiesUtils Signed-off-by: Tiago Rossi --- src/main/java/xades4j/utils/PropertiesUtils.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/xades4j/utils/PropertiesUtils.java b/src/main/java/xades4j/utils/PropertiesUtils.java index 0185fc8c..e0a771e2 100644 --- a/src/main/java/xades4j/utils/PropertiesUtils.java +++ b/src/main/java/xades4j/utils/PropertiesUtils.java @@ -135,19 +135,20 @@ public static void addXadesAVDProperties( Collection allCertificates = new HashSet(); Collection crlsAfterGracePeriod = new HashSet(); - Collection timeStamps = new ArrayList( - res.getPropertiesFilter().getOfType(AllDataObjsTimeStampProperty.class)); - timeStamps.addAll( + Collection validationTimeStamps = + new ArrayList( + res.getPropertiesFilter().getOfType(AllDataObjsTimeStampProperty.class)); + validationTimeStamps.addAll( res.getPropertiesFilter().getOfType(IndividualDataObjsTimeStampProperty.class)); - timeStamps.addAll( + validationTimeStamps.addAll( res.getPropertiesFilter().getOfType(SignatureTimeStampProperty.class)); - timeStamps.addAll( + validationTimeStamps.addAll( res.getPropertiesFilter().getOfType(SigAndRefsTimeStampProperty.class)); - timeStamps.addAll( + validationTimeStamps.addAll( res.getPropertiesFilter().getOfType(ArchiveTimeStampProperty.class)); /* get validation data that may be useful to add to TimeStampValidationData */ - for (BaseXAdESTimeStampProperty ts : timeStamps) + for (BaseXAdESTimeStampProperty ts : validationTimeStamps) { allCertificates.addAll(ts.getValidationData().getCerts()); From 0fa86676e73fc2a68b8837af2b17234a98b1e19e Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 24 Dec 2012 23:43:50 +0100 Subject: [PATCH 67/84] clean imports and add code comments Signed-off-by: Tiago Rossi --- .../impl/DefaultTimeStampVerificationProvider.java | 2 ++ .../verification/AttrAuthoritiesCertValuesVerifier.java | 1 - .../verification/QualifyingPropertyVerificationContext.java | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java index 35bf9463..f06f5013 100644 --- a/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java +++ b/src/main/java/xades4j/providers/impl/DefaultTimeStampVerificationProvider.java @@ -136,6 +136,8 @@ public TimeStampVerificationData verifyToken(byte[] timeStampToken, byte[] tsDig } if (ctx != null) { + // add only certificates and CRLs that use currently secure algorithms + // and are signed by currently valid certificate authorities tsaCertificateValidationProvider.addCertificates( ctx.getAttributeCertificates(), ctx.getCurrentTime()); tsaCertificateValidationProvider.addCRLs( diff --git a/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java b/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java index 1f3a4ec9..d2eb5c92 100644 --- a/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java +++ b/src/main/java/xades4j/verification/AttrAuthoritiesCertValuesVerifier.java @@ -24,7 +24,6 @@ import xades4j.properties.AttrAuthoritiesCertValuesProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.data.AttrAuthoritiesCertValuesData; -import xades4j.providers.TSACertificateValidationProvider; /** * diff --git a/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java b/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java index fdd912cc..a826e3d0 100644 --- a/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java +++ b/src/main/java/xades4j/verification/QualifyingPropertyVerificationContext.java @@ -330,11 +330,17 @@ public void addAttributeCRLs(Collection crls) untrustedAttributeCRLs.addAll(crls); } + /** + * @return list of untrusted CRLs read from properties + */ public Collection getAttributeCRLs() { return untrustedAttributeCRLs; } + /** + * @return list of untrusted certificates read from properties + */ public Collection getAttributeCertificates() { return untrustedAttributeCertificates; From f686109ce3b705d6bf9a665cc5c65a491bfea4bf Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 24 Dec 2012 23:46:44 +0100 Subject: [PATCH 68/84] add validation data before validating all properties Because we validate properties in reverse order, but they are created in chronological order, the certificates or CRLs may not yet be available, to work around this problem, first add all certificates and CRLs to verification context (as untrusted certificates) and only then validate all properties. fixes test case test04_3AVD_ver2 and test04_3AVD_ver4 from AgedTimeStampTest Signed-off-by: Tiago Rossi --- ...ybridQualifyingPropertiesVerifierImpl.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java b/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java index 24654e73..04c19208 100644 --- a/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java +++ b/src/main/java/xades4j/verification/HybridQualifyingPropertiesVerifierImpl.java @@ -31,10 +31,14 @@ import com.google.inject.Inject; import xades4j.XAdES4jException; +import xades4j.properties.AttrAuthoritiesCertValuesProperty; import xades4j.properties.QualifyingProperty; import xades4j.properties.SigAndRefsTimeStampProperty; import xades4j.properties.SignatureTimeStampProperty; import xades4j.properties.data.AllDataObjsTimeStampData; +import xades4j.properties.data.AttrAuthoritiesCertValuesData; +import xades4j.properties.data.AttributeRevocationValuesData; +import xades4j.properties.data.CertificateValuesData; import xades4j.properties.data.CommitmentTypeData; import xades4j.properties.data.CompleteCertificateRefsData; import xades4j.properties.data.CompleteRevocationRefsData; @@ -43,12 +47,14 @@ import xades4j.properties.data.PropertiesDataObjectsStructureVerifier; import xades4j.properties.data.PropertyDataObject; import xades4j.properties.data.PropertyDataStructureException; +import xades4j.properties.data.RevocationValuesData; import xades4j.properties.data.SignaturePolicyData; import xades4j.properties.data.SignatureProdPlaceData; import xades4j.properties.data.SignatureTimeStampData; import xades4j.properties.data.SignerRoleData; import xades4j.properties.data.SigningCertificateData; import xades4j.properties.data.SigningTimeData; +import xades4j.properties.data.TimeStampValidationDataData; import xades4j.xml.unmarshalling.QualifyingPropertiesDataCollector; public class HybridQualifyingPropertiesVerifierImpl implements @@ -102,6 +108,39 @@ public List verifyProperties( List unmarshalledProperties = dataCollector.getPropertiesData(); dataObjectsStructureVerifier.verifiyPropertiesDataStructure(unmarshalledProperties); + /* + * Because TSA or CA certificates may have been used in the past (in previous + * ArchiveTimeStamp) and included in TimeStampVerificationData or one of + * XAdES-X-L properties, it does not have to be present in subsequent + * TimeStampValidationData, we have to first go over all properties that can + * contain certificates other than time stamps themselves. + * + * Because the certificates have been added in chronological order, we too have + * to validate them in normal order + * + * TODO time stamp verifier won't use the certificates if the algorithms used + * to secure them are currently insecure (at the time of last validated timestamp) + * + * TODO make it work for CA certificates included in previous time stamp tokens + */ + for(PropertyDataObject pdo : unmarshalledProperties) + { + if (pdo instanceof CertificateValuesData || + pdo instanceof RevocationValuesData || + pdo instanceof AttrAuthoritiesCertValuesData || + pdo instanceof AttributeRevocationValuesData || + pdo instanceof TimeStampValidationDataData) + { + QualifyingPropertyVerifier propVerifier = + this.propertyVerifiersMapper.getVerifier(pdo); + + Element elem = (Element) dataCollector.getPropertyNode(pdo); + + // the verifier adds certificates and CRLs to context (ctx) + propVerifier.verify(pdo, elem, ctx); + } // else do nothing + } + List props = new LinkedList(); /* From c9e73a3f0fdf7dce48a72d5cf52d40ebecc80bd1 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 24 Dec 2012 23:45:09 +0100 Subject: [PATCH 69/84] don't fail windows-only tests on non-windows platforms Signed-off-by: Tiago Rossi --- src/test/java/xades4j/production/SignerTTest.java | 2 +- .../providers/impl/PKCS11KeyStoreKeyingDataProviderTest.java | 2 +- .../java/xades4j/verification/VerifyExternalSigsTest.java | 2 +- .../java/xades4j/verification/XadesVerifierErrorsTest.java | 5 +++-- .../java/xades4j/verification/XadesVerifierImplTest.java | 5 ++++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/test/java/xades4j/production/SignerTTest.java b/src/test/java/xades4j/production/SignerTTest.java index e6af39b3..4b36621d 100644 --- a/src/test/java/xades4j/production/SignerTTest.java +++ b/src/test/java/xades4j/production/SignerTTest.java @@ -118,7 +118,7 @@ public void testSignTPtCC() throws Exception if (!onWindowsPlatform()) { - fail("Test written for the Windows platform"); + return; } Document doc = getTestDocument(); diff --git a/src/test/java/xades4j/providers/impl/PKCS11KeyStoreKeyingDataProviderTest.java b/src/test/java/xades4j/providers/impl/PKCS11KeyStoreKeyingDataProviderTest.java index e3bc5e07..de0bdd84 100644 --- a/src/test/java/xades4j/providers/impl/PKCS11KeyStoreKeyingDataProviderTest.java +++ b/src/test/java/xades4j/providers/impl/PKCS11KeyStoreKeyingDataProviderTest.java @@ -48,7 +48,7 @@ public void testCertAndKeyMatch() throws Exception if (!onWindowsPlatform()) { - fail("Test written for the Windows platform"); + return; } try diff --git a/src/test/java/xades4j/verification/VerifyExternalSigsTest.java b/src/test/java/xades4j/verification/VerifyExternalSigsTest.java index 5bba5c10..114bf6e7 100644 --- a/src/test/java/xades4j/verification/VerifyExternalSigsTest.java +++ b/src/test/java/xades4j/verification/VerifyExternalSigsTest.java @@ -38,7 +38,7 @@ public class VerifyExternalSigsTest extends VerifierTestBase public void testVerifyPTTSL() throws Exception { if (!onWindowsPlatform()) - fail("Test written for Windows-ROOT certificate repository"); + return; FileSystemDirectoryCertStore certStore = createDirectoryCertStore("tsl/pt"); KeyStore ks = KeyStore.getInstance("Windows-ROOT"); diff --git a/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java b/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java index 86c8382c..53ef83f9 100644 --- a/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierErrorsTest.java @@ -55,8 +55,9 @@ public void testErrVerifySignedPropsIncorp() throws Exception public void testErrVerifySignedPropsIncorpNoRefType() throws Exception { System.out.println("errVerifySignedPropsIncorpNoRefType"); - - if (!onWindowsPlatform() || null == validationProviderPtCc) + if (!onWindowsPlatform()) + throw new QualifyingPropertiesIncorporationException("not on windows"); + if (null == validationProviderPtCc) fail("Test written for Windows-ROOT certificate repository"); verifyBadSignature("document.signed.bes.signedpropsrefnotype.xml", diff --git a/src/test/java/xades4j/verification/XadesVerifierImplTest.java b/src/test/java/xades4j/verification/XadesVerifierImplTest.java index 7505800b..17975f6b 100644 --- a/src/test/java/xades4j/verification/XadesVerifierImplTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierImplTest.java @@ -156,7 +156,10 @@ public void testVerifyTPTCC() throws Exception { System.out.println("verifyTPtCC"); - if (!onWindowsPlatform() || null == validationProviderPtCc) + if (!onWindowsPlatform()) + return; + + if (null == validationProviderPtCc) fail("Test written for Windows-ROOT certificate repository"); XAdESForm f = verifySignature("document.signed.t.bes.ptcc.xml", From 53b75c246b0148efdc9f646318bf4ccc94a10315 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Wed, 13 Jul 2016 13:14:54 -0300 Subject: [PATCH 70/84] Fix A form validation. From: Hubert Kario There is a major issue with validation of the A from. It fails for enveloping signature because of not correctly implementing XAdES v1.4.2 specification clause G.2.2.16.2.4, point 1) of particular rules for implicit mechanism. Here's a patch fixing the problem, to be applied on top of aforementioned patches. --- .../xades4j/verification/ArchiveTimeStampVerifier.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java index ae6979bd..b1661864 100644 --- a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java @@ -18,6 +18,7 @@ import org.apache.xml.security.exceptions.XMLSecurityException; import org.apache.xml.security.keys.KeyInfo; +import org.apache.xml.security.signature.ObjectContainer; import org.apache.xml.security.signature.Reference; import org.apache.xml.security.signature.SignedInfo; import org.apache.xml.security.utils.Constants; @@ -227,6 +228,15 @@ protected BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreatePrope }// else: ignore other properties } + /* take "all the ds:Object elements different to the one + * containing the QualifyingProperties." */ + for (int i = 0; i < ctx.getSignature().getObjectLength(); i++) + { + ObjectContainer obj = ctx.getSignature().getObjectItem(i); + if (null == DOMHelper.getFirstDescendant(obj.getElement(), QualifyingProperty.XADES_XMLNS, "*")) + digestInput.addNode(obj.getElement()); + } + if (certificateValuesPresent && revocationValuesPresent) return new ArchiveTimeStampProperty(); else From c7f31152226f9c43badfbe424d6bef853afb8fc5 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Thu, 14 Jul 2016 15:13:00 -0300 Subject: [PATCH 71/84] Add new crl for rootgva --- src/test/cert/gva/rootgva_der.crl | Bin 945 -> 945 bytes src/test/cert/gva/rootgva_der_07_04_2016.crl | Bin 0 -> 945 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/test/cert/gva/rootgva_der_07_04_2016.crl diff --git a/src/test/cert/gva/rootgva_der.crl b/src/test/cert/gva/rootgva_der.crl index 3f7af0bb5dbd48500e3583d75d5c608b1ee20a5b..ff6752fa4c8967281bc5b5e2fbaa00ff4597f615 100644 GIT binary patch delta 301 zcmV+|0n+}l2eAi`hZ#07GBP$WH#IOcGg=o7F*h(WGBq$aH83=>pkx67ev<_Ptbb9Jg>q;MH&b(%I)*IGXy%l#9Rri4d?u^i6Ds_ATdprR?o43S& z+M%|8dmc!w{_W)l{b@`#m@@^in{$Q14;h}l;6oEUALUmd0WulLGb6D7@_`K)NxG34 zSFffL?glOXU7qx$xr~ZaSoKMpM}JZI(;I{+6s&j0F;0?2mWL}Fp6(PQX5AV^-bqp* zOnqwk$l#Pc%%FU)1EKJ(ojwd=Z)=1oKH+kG;G*g)HFA6Ypc`O3ho0v@`3MW=Y^+K8 z0Cs@Ex@$Cn$r~O77Ua{6=!_>ChWr)MZ|f%}bD-vz-w9?k@ZUl( delta 301 zcmV+|0n+}l2eAi`hZ!|6G%z?YH!(CaGg=o7F*YzXFgGwaF*Gu0=Z140qFJAa=Q3EUN{+(;$`lL^)p|B1S~JLh0iFO*BdNcb~smQyUL2&5yDMm+qa~V+VnuO8xEuYFY zb_|rnf4Q`iz7rRtv2m?ewS}w>9=6Jb2FKMIJ%YQIP!MfXq3q^!Pm`Rn4FY=$ohOTf diff --git a/src/test/cert/gva/rootgva_der_07_04_2016.crl b/src/test/cert/gva/rootgva_der_07_04_2016.crl new file mode 100644 index 0000000000000000000000000000000000000000..3f7af0bb5dbd48500e3583d75d5c608b1ee20a5b GIT binary patch literal 945 zcmXqLVqR;|#59$Ok@5qwPB{BO@y-gF%KNw*e;`b0`a&Fq3Prp}c`Ch{Gi; z=AN3DT9lZRS&~?y5SEyenwOlJn3rhC4>SO%fLoX?z}wS3%+XNYKoumwEG!q4pI@Tj z?5KcUr#P>nsey@sg@L)DiIH&>kZT6ynnSq;O^m(<%1kWQQ-1#!=QS`iurx3+G&Qm? zG>kIfG2jB)AS=qk%*Dt6R^<9G2Cm4=z{tcDRS_Fl(dMvLh$16%Lo*XgLrW}*Tp~XU z0u`AV0G(!NWMXE7W)j#spduj@MQA3$6bU0MGB!cA4yH&1MUgocMXqh}uRw|njf@Np zEliBj9S%0hwd-;;vLYjNH!WyfZqT>{5^^Fe%uI~628~le!KlpA*lW<()gV%BdfDNU zOoe3H`w{_-J9hq?Dp>w3%vq8}za-JbV(t1g11&`|H!(6Y@EbSGwRCY`9wRwna<2U& zwtZ5f-vZ}MOc1@T{kyb(5#zg;=R%D{YTbP5)k9)`&GuO>lxA`;-sR6t=bJxwUX#4k zzkF#!>s&qid#eJLGR{^w%XrxIP7Jrk_41pI72Uy$zHq$Xb#<2Mp)8-3D{dU94&VD` z=|3OEIWa#!7&1Ev?y#OO%6Uh0^&Jm2*2$dLME`g0+GYJbAy|Kk_aToT`Wyc2pSrR5 z8^_%Z4_TTXUzX$FF+tNw>+fSXox;gySDx5C%dz0aH%&M9+G5FoH?vwUe$kzO%CwAU z%8~k=TPE)l7GJ!vaBcY3)-`-`+fKEz9lt7R+q8RHfIx2W!Z*)~{U^`a$Xm?~0KwxE ARR910 literal 0 HcmV?d00001 From af0f39195cdd8e00c693195b92cfaea48514ed14 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Fri, 15 Jul 2016 13:28:48 -0300 Subject: [PATCH 72/84] Update trusted CAs and CRLs --- src/test/cert/csrc.nist/readme.txt | 4 ++- src/test/cert/csrc.nist/trustAnchor | Bin 2399 -> 4440 bytes src/test/cert/gva/ACCVRAIZ1.crt | 44 ++++++++++++++++++++++++++++ src/test/cert/gva/raizaccv1_der.crl | Bin 0 -> 705 bytes src/test/cert/gva/readme.txt | 3 +- src/test/cert/gva/trustAnchor | Bin 1742 -> 3783 bytes src/test/cert/my/myStore | Bin 3456 -> 5498 bytes src/test/cert/my/readme.txt | 5 ++-- 8 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 src/test/cert/gva/ACCVRAIZ1.crt create mode 100644 src/test/cert/gva/raizaccv1_der.crl diff --git a/src/test/cert/csrc.nist/readme.txt b/src/test/cert/csrc.nist/readme.txt index 5808ab1d..4f42f6df 100644 --- a/src/test/cert/csrc.nist/readme.txt +++ b/src/test/cert/csrc.nist/readme.txt @@ -19,4 +19,6 @@ More info on the test certificates: http://csrc.nist.gov/groups/ST/crypto_apps_i keytool -importcert -alias TACP0101 -file "Trust Anchor CP.01.01.crt" -keystore trustAnchor -storepass password -keytool -importcert -alias accvCA -file "..\gva\rootgva.cer" -keystore trustAnchor -storepass password \ No newline at end of file +keytool -importcert -alias accvCA -file "..\gva\rootgva.cer" -keystore trustAnchor -storepass password + +keytool -importcert -alias accvraiz1 -file "..\gva\ACCVRAIZ1.crt" -keystore trustAnchor -storepass password diff --git a/src/test/cert/csrc.nist/trustAnchor b/src/test/cert/csrc.nist/trustAnchor index 22f0b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78gU +JyCpZET/LtZ1qmxNYEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+m +AM/EKXMRNt6GGT6d7hmKG9Ww7Y49nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepD +vV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJTS+xJlsndQAJxGJ3KQhfnlms +tn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3sCPdK6jT2iWH +7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h +I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szA +h1xA2syVP1XgNce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xF +d3+YJ5oyXSrjhO7FmGYvliAd3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2H +pPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3pEfbRD0tVNEYqi4Y7 +-----END CERTIFICATE----- diff --git a/src/test/cert/gva/raizaccv1_der.crl b/src/test/cert/gva/raizaccv1_der.crl new file mode 100644 index 0000000000000000000000000000000000000000..623a4e315fa95142ebe9c4ea7e6136c0a09ba15e GIT binary patch literal 705 zcmXqLV%lraxQvOB(SVnYQ>)FR?K>|cBR4C9fs>(-fdCtGC<`+Wr=zoTSdgP%2{8*Ik89i6M&96qH(hjJHy>PU|5j>Z8i$gA+15p;e!hCH zv3KS1`DxGj$`3|2_DAuY08hb96WU9 z*V1DvCn)wcLu{^|=)KQ4<8?Xg@N`sv}^75o6)A}qH6 literal 0 HcmV?d00001 diff --git a/src/test/cert/gva/readme.txt b/src/test/cert/gva/readme.txt index 9a98c884..4a329022 100644 --- a/src/test/cert/gva/readme.txt +++ b/src/test/cert/gva/readme.txt @@ -8,5 +8,6 @@ The default TSA is from http://www.accv.es/ and its certificate is issued by the ======== Trust-anchors keystore ========= +keytool -importcert -alias accvCA -file "rootgva.cer" -keystore trustAnchor -storepass password -keytool -importcert -alias accvCA -file "rootgva.cer" -keystore trustAnchor -storepass password \ No newline at end of file +keytool -importcert -alias accvraiz1 -file "ACCVRAIZ1.crt" -keystore trustAnchor -storepass password diff --git a/src/test/cert/gva/trustAnchor b/src/test/cert/gva/trustAnchor index 68d02c7413dd0099c64f654ff4a0a2f2b22d9722..721463e3d894a3f9b7b844286f487472a85804e9 100644 GIT binary patch delta 2023 zcmbtUc~lcu7k@Ju0*QoxAWJcj17ZXrnTUXj3y`3!N|hiDREU8{EPH}fiVnmGxFEEs zDNtlppi+uQP+XuO{Qy5vwt|4N$fAgXR)wOa&ZxjepQ30qEdnu|(B=8V|I?0j4@!9F< z%4f4RQ4J-wL|xU(-Bk&*Dd-X8tGBkY}5v)_11RQc6>dG zHOgLN&3-Tbk3s$!Lk64teRmAPZx0AEmcy{K!&>vZMiRy=VVu z9Uc|EFgD(1eT!Q-m^ENr<=ww5UTmWkaidxN)P8-Vp0r-wo0=}R{x5}>)A{}@?CuwK z-yua^`xT0oR~&lanQ(WmGvfAa-xUp6hx5@A!;q3q<8Qd3HTk!&JA~Sko3(*_(9NZ8 z#DqNl)UH_H;}VHt>VqMky?S!}^UZw@rzOwsY3$xeNZgP^&fm=um+cNanEvHhRi%B; zO^?)7`Nf6B*WvAE?H1*eEJXzCtWl+*5D6>jol&L{OM1|1P~uX1O< zx(qx0?o~>&%AlHJ7aQxT-z>BhESug%idw$ltSx`Ma?k8g%5w6Y?v)Y=vHGP@4(B!U zpFfcfMwS;IF`MXaQY2>-Hy%H3tq8Q!+^pCfZoaHLpW2>cximN8`=UmtXO0CUXE>eE z(XdlD>|dMOHqF})<(sLxT)cfux}cVp@KfE{;MY^n-9u_}Qm_X0WrttKTW8kY_-?cv z`(?~GJO14-uQjq`z8<~4lWB0ceflonVD36`=J%Z??wLsc?Ayu{UWMED9($R*;@uIa z`s8q#zP(04$th7m0~`65@0Kw+{vq6#e)YknW1VUKaaDrb2`F zi6x-|p*SKuK*$V{hM_#=!x$smQ4iED&n0hb68HZ}a6nLSG*cKIx;O@DR6IEtg5ZOc zi0UchXd(E3OjK9ag2Vgb`Fl1k&Q*LgK|sNVbD#Xd+2_L588uIy^jIZoOS9?o6kK&v zcvd|~A5vjzG#+ewr4UnVkZrxS530=jvU|%*GrKxBq8Zbv`6YA2RPLMq>Yj(AyAE!%-4gUvZp2FDG%Dke{D`p%+`(z8i4vXN5Lb=rS;xY))J0W(|p zsS})f@!Dwk4{?`@WLJrkvv(KR{Akw0O{wwvF2(4=RPaD za`=Z_Z`6cPZxj_Y|8^butbRYNQ)YUHxZJ4dP%34B;W++7-?FO}rv0l+I{VC$C&zhQ z&y+W|hvivcmi?yTLc#^GUdCuU%)Fa-bx`|ebd{pmhLHzjvo*8kfr7qdup|9o47T%Ce zQ??!2{IElwoa#|RpnZCk#1WWjyHavEzsH?n8i?N59-`vd?0 delta 62 zcmX>udyZG(-`jt085kItfS3_Xvn3`cmnA0xxn>)!TRv`7n8hZtZ`)+Mx$STFo{IUl NBYVOrZ$G;{4gicD7dQX_ diff --git a/src/test/cert/my/myStore b/src/test/cert/my/myStore index 1dd3e66ef501ba1b223c5a8e73d064e3b4789932..b4a93d686d79b4def74ff2984aec3d56f324c4a6 100644 GIT binary patch delta 2063 zcmbtUX;f3!7C!gp5=bNjWPS)_ffzwZZbU%E0SG9gQYA)PwwefGEa+56nHheV@~ zRdgshG% zipx+E5yNGoHte<=HPNTASg0LN8*CkH9k}`wTa>ldmi0;eJ3&6jkiuqvzB{A>FoG1O z0#pi+4owmB5q^RTuyu+f+s$!yoU{?E28Wmmb zcMcnzd_)%JwmI2En*Esjk46>4_Na!pd9(kjf?a;|Ei<-}Q_U|oHB$eLEwmQuPVXkg ztXOcIYN?o5JH?m5`Aytc&m{xV6-CD^#uaxnQ{*L0Cr{dD20LhO z$=niYsjDcUwxwDx&x`uLxXI=CQcjoqY=N$(NEL7bu-#;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%_mPLKdFfuubOOG} zW1hOR-ll&nU6GbjJnhfc%d&o7>|edEmgjK)c0i(0erCbkmuWAwX4QHNI!0bETBx>sZ511|q(EtDd delta 101 zcmeyR)gZ0#@9n?03=9lRK+FuL*-BE2OOg{A7#Ovh(q+zWR48HMWhqXBh sr!os4YkFBCOx545n-??9ViOVbe!Azv-+J?VLSk`Yth+WwZa#Ps04K5{+5i9m diff --git a/src/test/cert/my/readme.txt b/src/test/cert/my/readme.txt index 4ea60b2d..6818c2c3 100644 --- a/src/test/cert/my/readme.txt +++ b/src/test/cert/my/readme.txt @@ -30,8 +30,9 @@ pvk2pfx.exe -pvk LG.pvk -pi mykeypass -spc LG.cer -pfx LG.pfx --> ACCV CA for the TSA certificate - keytool -importcert -alias accvCA -file "..\gva\rootgva.cer" -keystore myStore -storepass mystorepass + keytool -importcert -alias accvCA -file "..\gva\rootgva.cer" -keystore myStore -storepass mystorepass + keytool -importcert -alias accvraiz1 -file "..\gva\ACCVRAIZ1.crt" -keystore myStore -storepass mystorepass --> Starfield Class 2 Certification Authority - keytool -importcert -alias sfCA -file "..\starfield\sf-class2-root.cer" -keystore myStore -storepass mystorepass \ No newline at end of file + keytool -importcert -alias sfCA -file "..\starfield\sf-class2-root.cer" -keystore myStore -storepass mystorepass From 81c60c1c09cb6058c25c705bba90575a79489f97 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Fri, 15 Jul 2016 14:14:00 -0300 Subject: [PATCH 73/84] Fix some tests. --- .../xades4j/production/SignerBESTest.java | 24 +- .../xades4j/production/TestResolverSpi.java | 45 +++ .../verification/CertPathBuilderTest.java | 26 +- .../verification/XadesVerifierImplTest.java | 23 +- src/test/xml/detached.bes.xml | 100 ++--- src/test/xml/document.verified.c.x.xml | 231 +++++++++++ src/test/xml/document.verified.c.xl.a.xml | 358 ++++++++++++++++++ 7 files changed, 736 insertions(+), 71 deletions(-) create mode 100644 src/test/java/xades4j/production/TestResolverSpi.java create mode 100644 src/test/xml/document.verified.c.x.xml create mode 100644 src/test/xml/document.verified.c.xl.a.xml diff --git a/src/test/java/xades4j/production/SignerBESTest.java b/src/test/java/xades4j/production/SignerBESTest.java index c332c222..5d3232ae 100644 --- a/src/test/java/xades4j/production/SignerBESTest.java +++ b/src/test/java/xades4j/production/SignerBESTest.java @@ -17,6 +17,13 @@ package xades4j.production; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import org.apache.xml.security.signature.XMLSignatureInput; +import org.apache.xml.security.utils.resolver.ResourceResolver; +import org.apache.xml.security.utils.resolver.ResourceResolverContext; +import org.apache.xml.security.utils.resolver.ResourceResolverException; +import org.apache.xml.security.utils.resolver.ResourceResolverSpi; import xades4j.algorithms.EnvelopedSignatureTransform; import xades4j.properties.DataObjectDesc; import xades4j.properties.AllDataObjsCommitmentTypeProperty; @@ -129,21 +136,24 @@ public void testSignBESDetachedWithXPathAndNamespaces() throws Exception XadesSigner signer = new XadesBesSigningProfile(keyingProviderMy) .withBasicSignatureOptionsProvider(MyBasicSignatureOptionsProvider.class) .newSigner(); - - String fileUti = new File("src/test/xml/document.xml").toURI().toString(); - DataObjectDesc obj1 = new DataObjectReference(fileUti) + + DataObjectDesc obj1 = new DataObjectReference("xades4j://document.xml") .withTransform( new XPathTransform("/collection/album/foo:tracks") .withNamespace("foo", "http://test.xades4j/tracks")) .withDataObjectFormat(new DataObjectFormatProperty("text/xml")); - - DataObjectDesc obj2 = new DataObjectReference(fileUti) + + DataObjectDesc obj2 = new DataObjectReference("xades4j://document.xml") .withTransform( XPath2Filter.intersect("/collection/album/bar:tracks/bar:song[@tracknumber = 1]") .withNamespace("bar", "http://test.xades4j/tracks")); - - signer.sign(new SignedDataObjects(obj1, obj2), doc); + + TestResolverSpi resolverSpi = new TestResolverSpi(); + SignedDataObjects dataObjs = new SignedDataObjects(obj1, obj2) + .withResourceResolver(new ResourceResolver(resolverSpi)); + signer.sign(dataObjs, doc); outputDocument(doc, "detached.bes.xml"); } + } diff --git a/src/test/java/xades4j/production/TestResolverSpi.java b/src/test/java/xades4j/production/TestResolverSpi.java new file mode 100644 index 00000000..6bdfd763 --- /dev/null +++ b/src/test/java/xades4j/production/TestResolverSpi.java @@ -0,0 +1,45 @@ +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2010 Luis Goncalves. + * Copyright (C) 2012 Hubert Kario - QBS. + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.production; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import org.apache.xml.security.signature.XMLSignatureInput; +import org.apache.xml.security.utils.resolver.ResourceResolverContext; +import org.apache.xml.security.utils.resolver.ResourceResolverException; +import org.apache.xml.security.utils.resolver.ResourceResolverSpi; + +public class TestResolverSpi extends ResourceResolverSpi { + + @Override + public XMLSignatureInput engineResolveURI(ResourceResolverContext context) throws ResourceResolverException { + try { + String fileName = context.uriToResolve.replace("xades4j://", ""); + return new XMLSignatureInput(new FileInputStream(new File("src/test/xml/" + fileName))); + } catch (FileNotFoundException ex) { + throw new ResourceResolverException(ex.getMessage(), context.uriToResolve, "src/test/xml/"); + } + } + + @Override + public boolean engineCanResolveURI(ResourceResolverContext context) { + return context.attr.getValue().startsWith("xades4j:"); + } + +} diff --git a/src/test/java/xades4j/verification/CertPathBuilderTest.java b/src/test/java/xades4j/verification/CertPathBuilderTest.java index d77a893b..c7c55d5a 100644 --- a/src/test/java/xades4j/verification/CertPathBuilderTest.java +++ b/src/test/java/xades4j/verification/CertPathBuilderTest.java @@ -16,6 +16,7 @@ */ package xades4j.verification; +import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.math.BigInteger; @@ -42,6 +43,7 @@ import org.bouncycastle.asn1.x509.CRLReason; import org.bouncycastle.x509.ExtendedPKIXParameters; import org.junit.Test; +import static xades4j.utils.SignatureServicesTestBase.toPlatformSpecificFilePath; import xades4j.verification.FullCert.CRLEntries; @@ -153,9 +155,8 @@ public void test1() throws Exception buildParams.setRevocationEnabled(true); buildParams.setDate(new Date(new Date().getTime() - 1000*60*15)); - ExtendedPKIXParameters extBuildParams = ExtendedPKIXParameters.getInstance(buildParams); - extBuildParams.setValidityModel(ExtendedPKIXParameters.PKIX_VALIDITY_MODEL); - + //ExtendedPKIXParameters extBuildParams = ExtendedPKIXParameters.getInstance(buildParams); + //extBuildParams.setValidityModel(ExtendedPKIXParameters.PKIX_VALIDITY_MODEL); PKIXCertPathBuilderResult result = (PKIXCertPathBuilderResult) builder.build(buildParams); CertPath certPath = result.getCertPath(); @@ -210,24 +211,29 @@ public void test2() throws Exception /* * end of tests */ + private static File ensureOutputDir() { + File dir = new File(toPlatformSpecificFilePath("./target/out/cert/certpath")); + dir.mkdirs(); + return dir; + } // helper method - private static void saveCRL(String path, X509CRL crl) + private static void saveCRL(String fileName, X509CRL crl) throws CRLException, IOException { - path = "./src/test/cert/certpath/" + path; - FileOutputStream fos = new FileOutputStream(path); + File outDir = ensureOutputDir(); + FileOutputStream fos = new FileOutputStream(new File(outDir, fileName)); fos.write(crl.getEncoded()); fos.close(); return; } // helper method - private static void saveCertificate(String path, X509Certificate cert) - throws CertificateEncodingException, IOException + private static void saveCertificate(String fileName, X509Certificate cert) + throws CertificateEncodingException, IOException { - path = "./src/test/cert/certpath/" + path; - FileOutputStream fos = new FileOutputStream(path); + File outDir = ensureOutputDir(); + FileOutputStream fos = new FileOutputStream(new File(outDir, fileName)); fos.write(cert.getEncoded()); fos.close(); return; diff --git a/src/test/java/xades4j/verification/XadesVerifierImplTest.java b/src/test/java/xades4j/verification/XadesVerifierImplTest.java index 7e5f4ce1..a3c0a0a9 100644 --- a/src/test/java/xades4j/verification/XadesVerifierImplTest.java +++ b/src/test/java/xades4j/verification/XadesVerifierImplTest.java @@ -18,13 +18,16 @@ import java.io.FileInputStream; import java.io.InputStream; +import org.apache.xml.security.utils.resolver.ResourceResolver; import static org.junit.Assert.*; import static org.junit.Assume.assumeTrue; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; +import xades4j.production.TestResolverSpi; import xades4j.production.XadesFormatExtenderProfile; import xades4j.production.XadesSignatureFormatExtender; import xades4j.properties.ArchiveTimeStampProperty; @@ -34,6 +37,7 @@ import xades4j.properties.QualifyingProperty; import xades4j.properties.RevocationValuesProperty; import xades4j.properties.SigAndRefsTimeStampProperty; +import static org.junit.Assume.assumeTrue; /** * @@ -85,8 +89,14 @@ public void verify(RawSignatureVerifierContext ctx) throws InvalidSignatureExcep public void testVerifyDetachedBES() throws Exception { System.out.println("verifyDetachedBES"); - XAdESForm f = verifySignature("detached.bes.xml"); - assertEquals(XAdESForm.BES, f); + + Document doc = getDocument("detached.bes.xml"); + Element signatureNode = getSigElement(doc); + + SignatureSpecificVerificationOptions options = new SignatureSpecificVerificationOptions().useResourceResolver(new ResourceResolver(new TestResolverSpi())); + + XAdESVerificationResult res = verificationProfile.newVerifier().verify(signatureNode, options); + assertEquals(XAdESForm.BES, res.getSignatureForm()); } @Test @@ -160,9 +170,14 @@ public void testVerifyTEPES() throws Exception assertEquals(XAdESForm.T, f); } + /** + * XXX fails because we do not have a signed document with valid ptcc certificate + * + * @throws Exception + */ @Test - public void testVerifyTPTCC() throws Exception - { + @Ignore + public void testVerifyTPTCC() throws Exception { System.out.println("verifyTPtCC"); assumeTrue(onWindowsPlatform() && null != validationProviderPtCc); diff --git a/src/test/xml/detached.bes.xml b/src/test/xml/detached.bes.xml index 41b1a88f..9c6f4ff7 100644 --- a/src/test/xml/detached.bes.xml +++ b/src/test/xml/detached.bes.xml @@ -1,51 +1,51 @@ - - - - - - -/collection/album/foo:tracks - - -rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - - - -/collection/album/bar:tracks/bar:song[@tracknumber = 1] - - -N8H6u8UbT1bF40ELhV57g/PJppBg9pOXEiz/QuA6wrk= - - - -fkHX0jswj0W/uE/5h/twim33KF965DHyrORZNbu9xcc= - - - -xjcrqF+6Tg8JVl+s9xudbC/2xkSo4YT+xJnbrblvwMM= - - - -MDDh+3SImDO+7N8YbquTV4loGt6gTln8eVfb0TpQhjrodkYOjTQzwK0c+ZFjUNGZBYT65/zKoG2P -VsxKCdNqD5LNdQyhikWSPxUmbQfSGTHDd8RHLoJGdRWaaRUnbe1vxMHgaY9gE0zI+/kcueS/EcAp -GfN/PxJzyF9h3hCznnA= - - - - -MIICbTCCAdqgAwIBAgIQpkK0uals+ItHxBlpJuypOTAJBgUrDgMCHQUAMD8xCzAJBgNVBAYTAlBU -MQ0wCwYDVQQKEwRJU0VMMQswCQYDVQQLEwJDQzEUMBIGA1UEAxMLSXRlcm1lZGlhdGUwHhcNMTAw -NjI1MTc1ODQ5WhcNMzkxMjMxMjM1OTU5WjBCMQswCQYDVQQGEwJQVDENMAsGA1UEChMESVNFTDEL -MAkGA1UECxMCQ0MxFzAVBgNVBAMTDkx1aXMgR29uY2FsdmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQCpP9acMX69Dbg9ciMLFc5dm1tlpTY9OTNZ/EaCYoGVhh/3+DFgyIbEer6SA24hpREm -AhNG9+Ca0AurDPPgb3aKWFY9pj1WcOctis0VsR0YvzqP+2IGFqKDCd7bXFvv2tI0dEvpdc0oO6PF -Q02xvJG0kxQf44XljOCjUBU43jkJawIDAQABo28wbTBrBgNVHQEEZDBigBBdbbL4pDKLT56PpOpA -/56toTwwOjELMAkGA1UEBhMCUFQxDTALBgNVBAoTBElTRUwxCzAJBgNVBAsTAkNDMQ8wDQYDVQQD -EwZUZXN0Q0GCEN00x9qe7SuWQvpLK0/oay8wCQYFKw4DAh0FAAOBgQBSma8g9dQjiQo4WUljRRuG -yMUVRyCqW/9oRz8+0EoLNR/AhrIlGqdNbqQ1BkncgNNdqMAus5VD34v/EhgrkgWN5fZajMpYsmcR -Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== - - - -2015-09-27T22:08:48.642+01:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869text/xml + + + + + + +/collection/album/foo:tracks + + +rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= + + + +/collection/album/bar:tracks/bar:song[@tracknumber = 1] + + +N8H6u8UbT1bF40ELhV57g/PJppBg9pOXEiz/QuA6wrk= + + + +0CAf5hH5cebOBuFsF74xF6cPNjw7GlYUU9b/U23uppc= + + + +exEZrq7PXJDHOXoE4DZO2bqqzmSUSZ6RDMmQEOaP2FE= + + + +nhisKQ3DXqaPTmAEqpc9pZyXz1rLYnqewX+wFisPJ7P4EcI8sM0iGM0P5uS5kClhkPIO6c20yFPo +5pdx1S+hC1UTvrNvdMt+hs2d93DwIJmeYybCTNEcZgP+U6BCMveT1krrGkd9XdpY2hKN06nSN7kR +3JwCPN5SYXE4mHr2pfA= + + + + +MIICbTCCAdqgAwIBAgIQpkK0uals+ItHxBlpJuypOTAJBgUrDgMCHQUAMD8xCzAJBgNVBAYTAlBU +MQ0wCwYDVQQKEwRJU0VMMQswCQYDVQQLEwJDQzEUMBIGA1UEAxMLSXRlcm1lZGlhdGUwHhcNMTAw +NjI1MTc1ODQ5WhcNMzkxMjMxMjM1OTU5WjBCMQswCQYDVQQGEwJQVDENMAsGA1UEChMESVNFTDEL +MAkGA1UECxMCQ0MxFzAVBgNVBAMTDkx1aXMgR29uY2FsdmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCpP9acMX69Dbg9ciMLFc5dm1tlpTY9OTNZ/EaCYoGVhh/3+DFgyIbEer6SA24hpREm +AhNG9+Ca0AurDPPgb3aKWFY9pj1WcOctis0VsR0YvzqP+2IGFqKDCd7bXFvv2tI0dEvpdc0oO6PF +Q02xvJG0kxQf44XljOCjUBU43jkJawIDAQABo28wbTBrBgNVHQEEZDBigBBdbbL4pDKLT56PpOpA +/56toTwwOjELMAkGA1UEBhMCUFQxDTALBgNVBAoTBElTRUwxCzAJBgNVBAsTAkNDMQ8wDQYDVQQD +EwZUZXN0Q0GCEN00x9qe7SuWQvpLK0/oay8wCQYFKw4DAh0FAAOBgQBSma8g9dQjiQo4WUljRRuG +yMUVRyCqW/9oRz8+0EoLNR/AhrIlGqdNbqQ1BkncgNNdqMAus5VD34v/EhgrkgWN5fZajMpYsmcR +Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== + + + +2016-07-15T14:00:22.213-03:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869text/xml \ No newline at end of file diff --git a/src/test/xml/document.verified.c.x.xml b/src/test/xml/document.verified.c.x.xml new file mode 100644 index 00000000..181294db --- /dev/null +++ b/src/test/xml/document.verified.c.x.xml @@ -0,0 +1,231 @@ + + + Questions, unanswered + Steve and the flubberblubs + 1989 + + + What do you know? + Steve and the flubberblubs + 2006-10-17-08:31 + + + Who do you know? + Steve and the flubberblubs + 2006-10-17-08:35 + + + When do you know? + Steve and the flubberblubs + 2006-10-17-08:39 + + + Do you know? + Steve and the flubberblubs + 2006-10-17-08:44 + + + + + + + + + + + + +rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= + + + +aUk8iTN0h7Snb2gsR/SVc6rDbNBWVbBEKUoX5jMyujU= + + + +P06o2MQxP+6FNykD21GCPXnTVlJqxhRT3RUoo9oeEGY6iglq/A6b1lPANQyqVcD/od6nj1HaZ4pf +Kb/Pekgg5Z5pYcVICQ6Wd2jYC95WSCjnc7dA/l4uyZ+j/9jW2i2bzxNG3ORkj12j6RTnbkVH4Pz9 +9WFQqkHYHRkp1XV8Uww= + + + + +MIIChjCCAe+gAwIBAgIBCDANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQGEwJVUzEYMBYGA1UEChMP +VS5TLiBHb3Zlcm5tZW50MQwwCgYDVQQLEwNEb2QxEDAOBgNVBAsTB1Rlc3RpbmcxFTATBgNVBAMT +DENBMi1DUC4wMi4wMTAeFw05OTAxMDExMjAxMDBaFw00ODAxMDExMjAxMDBaMGAxCzAJBgNVBAYT +AlVTMRgwFgYDVQQKEw9VLlMuIEdvdmVybm1lbnQxDDAKBgNVBAsTA0RvRDEQMA4GA1UECxMHVGVz +dGluZzEXMBUGA1UEAxMOVXNlcjEtQ1AuMDIuMDEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +AOzYq2murB5ZjQd4wReI51Lc1F5VwK90OMGRfi71YvwdRjgCudeDXZGW5ayid82y+eTDKFSzo1Li +/BPTUXMpeqHHMCmLeefqxAWmz3aDoilF8IQ53PlejnXJdntsal44w6WdP6ssiXlwzcZDnobAfuDT +PgsnWWfzAkr1/LqEw/QZAgMBAAGjUjBQMA4GA1UdDwEB/wQEA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yEDLrvOcbTuby+z91SnMANLBW4Xf3XSEoJC5snPTyWeQeKTJpmp2A16+ +Ns1fcLqVm0Z4eCjx7VZ+t5nNsy7NdRo2G0S8EUTaYWE9S2Z+fWWhpQhEKtmpAbCsJoIk36rQIMo7 +dsST8VmMv+lghiTU+bthB1FSrXTLwmz69RMsa6P5J0CZH6yeF55bJQ80LQduis8E+5iasqkJeKSa +kFj8WXPKS7v0nLk3jDA5npAkvQO2QknkV9XkYcZGFUeFmk3sNisZSjOlYRXNowOEIQ5end2qeqR1 +l47EpaH8v54guy3ZmKbWjXerFiiO/IEBW+7mFhbavS3aGqPO+AAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1MIAGCSqGSIb3DQEHAqCAMIIVAgIBAzELMAkGBSsOAwIaBQAwggE3BgsqhkiG9w0BCRABBKCCASYE +ggEiMIIBHgIBAQYLKwYBBAG/VQNkAgAwITAJBgUrDgMCGgUABBRCG+JPtKN6FA2EoOFh/o2rbJ64 +ggIE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wEQUNDVjEL +MAkGA1UEBhMCRVMCCF7Dt6ZDf6TgMA0GCSqGSIb3DQEBAQUABIICAJdMiERJCEC+NKlnZhp2I6sT +A8ZZfBaRwuCX4GsFpcS+M7ZuTzCdlFUef2ePo0SMF628zCVL/ZXXCGIEFN6ERNVjXJn+xYbsssy9 +ET5uC7G3S49KI7HjbQsUuWIKdRt47te3/Kjbj7sWWPq3v0b+zGlZOg39/Us7uuaJk58M8tyV57v0 +vtL4Qtk8QhlTeea7Pnv9TuQUZx8g7nT/9hyDCZHZp75kR21Mn48KV4fkIFQYfto1bS8XO+nnuCBX +XbKlQejETvGoxTXHUrqqYWpAE3yEhnYjORnMbANLJ9LnYpqSoYBzTbYozBhyfLuQjycS/iNif7kQ +Z4l6o84hhXxGiu/zvABPvw6+xCrg2YZlg9MB0XZJdMSBWbaEHgCroBjN5gzPGEhwc2mOLGE+48dF +bX+ODlf32WvvBU32t4O5EHTFyyUHYK3C/jGgGlkmAx8GJyGr7xoeOkfJI2EWWXZ+4BBU6g5BzQdX +ffXvq6OBj6G5qwdh7q4Uc1oKoIFTihVXI8la+SZt0D623lt52efJrNnliLT2cIp2B5xSr2dRQjWT +BgEZtYymfq8BzbnnOcv3FmnuBafno5MUBgI/ZXaWrQRS2cldXFKrHQiRcxWTVvaR+2iCfcYgq6cA +00zhzBDk964uT0/in3O9I0MnO2lFvgPG+YiBAjnWC6MNannzDXYnAAAAAA== + \ No newline at end of file diff --git a/src/test/xml/document.verified.c.xl.a.xml b/src/test/xml/document.verified.c.xl.a.xml new file mode 100644 index 00000000..536b814b --- /dev/null +++ b/src/test/xml/document.verified.c.xl.a.xml @@ -0,0 +1,358 @@ + + + Questions, unanswered + Steve and the flubberblubs + 1989 + + + What do you know? + Steve and the flubberblubs + 2006-10-17-08:31 + + + Who do you know? + Steve and the flubberblubs + 2006-10-17-08:35 + + + When do you know? + Steve and the flubberblubs + 2006-10-17-08:39 + + + Do you know? + Steve and the flubberblubs + 2006-10-17-08:44 + + + +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55bJQ80LQduis8E+5iasqkJeKSa +kFj8WXPKS7v0nLk3jDA5npAkvQO2QknkV9XkYcZGFUeFmk3sNisZSjOlYRXNowOEIQ5end2qeqR1 +l47EpaH8v54guy3ZmKbWjXerFiiO/IEBW+7mFhbavS3aGqPO+AAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1MIAGCSqGSIb3DQEHAqCAMIIPNgIBAzELMAkGBSsOAwIaBQAwgcUGCyqGSIb3DQEJEAEEoIG1BIGy +MIGvAgEBBgwrBgEEAb9VAwIBAQAwITAJBgUrDgMCGgUABBRCG+JPtKN6FA2EoOFh/o2rbJ64ggIE +QUv+xRgPMjAxNDA1MTEyMTA4MThaAQH/AgYBRe0ddtegV6RVMFMxCzAJBgNVBAYTAkVTMR8wHQYD +VQQKExZHZW5lcmFsaXRhdCBWYWxlbmNpYW5hMQ8wDQYDVQQLEwZQS0lHVkExEjAQBgNVBAMTCVRT +QTEgQUNDVqCCC5wwggUJMIID8aADAgECAgR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vwf6tcm8VZb2DfCuzT0LRQzkSb9O5/oT2x3k1GrYA4AuK1hgc93r9Koupix9ib1uqEXiT +m1BHkZdKForhY4KsHbVtSjbwJBrW1/jWcg6TjgxU+U/aLIuJyh1rAAAAAA== + \ No newline at end of file From f4fa32911d409e652d3f3c091e496b188854481d Mon Sep 17 00:00:00 2001 From: Leandro Souza Costa Date: Thu, 4 Aug 2016 12:02:01 -0300 Subject: [PATCH 74/84] Fix some tests --- .../verification/AgedTimeStampTest.java | 85 ++++++++++--------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/src/test/java/xades4j/verification/AgedTimeStampTest.java b/src/test/java/xades4j/verification/AgedTimeStampTest.java index 7a6c2d1b..376c17a3 100644 --- a/src/test/java/xades4j/verification/AgedTimeStampTest.java +++ b/src/test/java/xades4j/verification/AgedTimeStampTest.java @@ -54,8 +54,10 @@ import org.apache.xml.security.utils.Constants; import org.bouncycastle.asn1.x509.CRLReason; +import org.junit.FixMethodOrder; import org.junit.Ignore; import org.junit.Test; +import org.junit.runners.MethodSorters; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -86,7 +88,7 @@ * @author Hubert Kario * */ -@Ignore +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class AgedTimeStampTest { private static final CertStore emptyCertStore; @@ -657,7 +659,7 @@ private static void createXadesXCerts(Date now) throws Exception, "CN=XAdES4j XAdES-X TSA 1", new Date(now.getTime() - ONE_HOUR_IN_MS * 21), new Date(now.getTime() - ONE_HOUR_IN_MS * 12), - new BigInteger("1"), + new BigInteger("2"), "SHA256withRSA"); System.out.println("TSA certificate " + test02_X_tsa1Cert.getCertificate().getSubjectDN().toString() + @@ -881,7 +883,7 @@ private static void createXadesACerts(Date now) "CN=XAdES-A testing A form TSA", new Date(now.getTime() - 11 * ONE_HOUR_IN_MS), new Date(now.getTime() + ONE_HOUR_IN_MS), - new BigInteger("1"), + new BigInteger("2"), "SHA256withRSA"); tsaCaCrlEntries = test03_A_tsaCaCert.new CRLEntries(); @@ -1023,7 +1025,7 @@ public void init() throws Exception // test creation of document with time stamp in the past @Test - public void test01_T_sig1() throws Exception + public void test01_01_T_sig1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1048,7 +1050,7 @@ public void test01_T_sig1() throws Exception // test if document can be validated using revocation information published before // time stamp generation (TODO should fail if we support grace period) @Test - public void test01_T_ver1() throws Exception + public void test01_02_T_ver1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1061,7 +1063,7 @@ public void test01_T_ver1() throws Exception // test if document can be validated using current revocation information @Test - public void test01_T_ver2() throws Exception + public void test01_03_T_ver2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1079,7 +1081,8 @@ public void test01_T_ver2() throws Exception // BC provider has such behavior for revocation reason unspecified, keyCompromise, // aACompromise and few others @Test - public void test01_T_ver3() throws Exception + @Ignore + public void test01_04_T_ver3() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1118,7 +1121,7 @@ public void test01_T_ver3() throws Exception // exact same test as testT_3v, with the change to a more "harmless" revocation // reason than unspecified: affiliation changed. @Test - public void test01_T_ver3_1() throws Exception + public void test01_05_T_ver3_1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1156,7 +1159,7 @@ public void test01_T_ver3_1() throws Exception // test if document can be validated if user certificate was revoked before // signature was time stamped @Test(expected = CannotBuildCertificationPathException.class) - public void test01_T_ver4() throws Exception + public void test01_06_T_ver4() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1218,7 +1221,7 @@ public void test01_T_ver4() throws Exception // create basic XAdES-T signed document @Test - public void test02_X_sig1() throws Exception + public void test02_01_X_sig1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test02_X_sig1.xml"); @@ -1242,7 +1245,7 @@ public void test02_X_sig1() throws Exception // extend T form to X form @Test - public void test02_X_sig2() throws Exception + public void test02_02_X_sig2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test02_X_sig2.xml"); @@ -1291,7 +1294,7 @@ public void test02_X_sig2() throws Exception // extend X to X-L form @Test - public void test02_X_sig3() throws Exception + public void test02_03_X_sig3() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test02_X_sig3.xml"); @@ -1318,7 +1321,7 @@ public void test02_X_sig3() throws Exception // verify if the X form was properly created @Test - public void test02_X_ver1() throws Exception + public void test02_04_X_ver1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1333,7 +1336,7 @@ public void test02_X_ver1() throws Exception // verify if the X-L form was properly created by using validators with just CA // certificates and current CRLs for TSA @Test - public void test02_X_ver2() throws Exception + public void test02_05_X_ver2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1376,7 +1379,7 @@ public void test02_X_ver2() throws Exception // create basic XAdES-T signed document @Test - public void test03_T_sig1() throws Exception + public void test03_01_T_sig1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test03_T_sig1.xml"); @@ -1400,7 +1403,7 @@ public void test03_T_sig1() throws Exception // extend T form to X form @Test - public void test03_X_sig2() throws Exception + public void test03_02_X_sig2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test03_X_sig2.xml"); @@ -1449,7 +1452,7 @@ public void test03_X_sig2() throws Exception // extend X to X-L form @Test - public void test03_X_sig3() throws Exception + public void test03_03_X_sig3() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test03_X_sig3.xml"); @@ -1476,7 +1479,7 @@ public void test03_X_sig3() throws Exception // extend X-L form to A form @Test - public void test03_A_sig4() throws Exception + public void test03_04_A_sig4() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test03_A_sig4.xml"); @@ -1519,7 +1522,7 @@ public void test03_A_sig4() throws Exception // verify A form @Test - public void test03_A_ver1() throws Exception + public void test03_05_A_ver1() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1533,7 +1536,7 @@ public void test03_A_ver1() throws Exception // add validation info to A form @Test - public void test03_A_sig5() throws Exception + public void test03_06_A_sig5() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test03_A_sig5.xml"); @@ -1561,7 +1564,7 @@ public void test03_A_sig5() throws Exception // verify A form using minimal validators @Test - public void test03_A_ver2() throws Exception + public void test03_07_A_ver2() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); @@ -1575,7 +1578,7 @@ public void test03_A_ver2() throws Exception // time stamp A(VD) form again @Test - public void test03_A_sig6() throws Exception + public void test03_08_A_sig6() throws Exception { System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()); String outFileName = new String("document.aged.test03_A_sig6.xml"); @@ -1671,7 +1674,7 @@ public void test03_A_sig6() throws Exception // create XAdES-T form @Test - public void test04_T_sig1() throws Exception + public void test04_01_T_sig1() throws Exception { System.out.println("test04_T_sig1"); @@ -1695,7 +1698,7 @@ public void test04_T_sig1() throws Exception // add second XAdES-T time stamp @Test - public void test04_T_sig2() throws Exception + public void test04_02_T_sig2() throws Exception { System.out.println("test04_T_sig2"); @@ -1788,7 +1791,7 @@ public void test04_T_sig2() throws Exception // add references to signature data @Test - public void test04_C_sig3() throws Exception + public void test04_03_C_sig3() throws Exception { System.out.println("test04_C_sig3"); @@ -1856,7 +1859,7 @@ public void test04_C_sig3() throws Exception // add second type of time stamp to signature (SigAndRefsTimeStamp) @Test - public void test04_X_sig4() throws Exception + public void test04_04_X_sig4() throws Exception { System.out.println("test04_X_sig4"); Date now = new Date(realNow.getTime() - 13 * ONE_YEAR_IN_MS); @@ -1934,7 +1937,7 @@ public void test04_X_sig4() throws Exception // add second SigAndRefsTimeStamp @Test - public void test04_X_sig5() throws Exception + public void test04_05_X_sig5() throws Exception { System.out.println("test04_X_sig5"); Date now = new Date(realNow.getTime() - 13 * ONE_YEAR_IN_MS + ONE_HOUR_IN_MS / 2); @@ -2012,7 +2015,7 @@ public void test04_X_sig5() throws Exception // add certificates to signature (X-L form) @Test - public void test04_XL_sig6() throws Exception + public void test04_06_XL_sig6() throws Exception { System.out.println("test04_XL_sig6"); @@ -2091,7 +2094,7 @@ public void test04_XL_sig6() throws Exception // add first Archival Time Stamp @Test - public void test04_A_sig7() throws Exception + public void test04_07_A_sig7() throws Exception { System.out.println("test04_A_sig7"); Date now = new Date(realNow.getTime() - 9 * ONE_YEAR_IN_MS); @@ -2170,7 +2173,7 @@ public void test04_A_sig7() throws Exception // add second Archival time stamp @Test - public void test04_A_sig8() throws Exception + public void test04_08_A_sig8() throws Exception { System.out.println("test04_A_sig8"); Date now = new Date(realNow.getTime() - 9 * ONE_YEAR_IN_MS + ONE_HOUR_IN_MS / 60); @@ -2250,7 +2253,7 @@ public void test04_A_sig8() throws Exception } @Test - public void test04_AVD_sig9() throws Exception + public void test04_09_AVD_sig9() throws Exception { System.out.println("test04_AVD_sig9"); @@ -2330,7 +2333,7 @@ public void test04_AVD_sig9() throws Exception // add second group of A time stamps @Test - public void test04_2A_sig10() throws Exception + public void test04_10_2A_sig10() throws Exception { System.out.println("test04_2A_sig10"); Date now = new Date(realNow.getTime() - 5 * ONE_YEAR_IN_MS); @@ -2402,7 +2405,7 @@ public void test04_2A_sig10() throws Exception // add second time stamp in second group of timestamps @Test - public void test04_2A_sig11() throws Exception + public void test04_11_2A_sig11() throws Exception { System.out.println("test04_2A_sig11"); Date now = new Date(realNow.getTime() - 5 * ONE_YEAR_IN_MS + ONE_HOUR_IN_MS); @@ -2474,7 +2477,7 @@ public void test04_2A_sig11() throws Exception // add revocation information about first group of archive time stamps @Test - public void test04_2AVD_sig12() throws Exception + public void test04_12_2AVD_sig12() throws Exception { System.out.println("test04_2AVD_sig12"); @@ -2547,7 +2550,7 @@ public void test04_2AVD_sig12() throws Exception // add first timestamp to third group of timestamps @Test - public void test04_3A_sig13() throws Exception + public void test04_13_3A_sig13() throws Exception { System.out.println("test04_3A_sig13"); Date now = new Date(realNow.getTime() - 1 * ONE_YEAR_IN_MS); @@ -2619,7 +2622,7 @@ public void test04_3A_sig13() throws Exception // add second timestamp to third group of timestamps @Test - public void test04_3A_sig14() throws Exception + public void test04_14_3A_sig14() throws Exception { System.out.println("test04_3A_sig14"); Date now = new Date(realNow.getTime() - 1 * ONE_YEAR_IN_MS + ONE_HOUR_IN_MS); @@ -2699,7 +2702,7 @@ public void test04_3A_sig14() throws Exception // add revocation information about second group of archive time stamps @Test - public void test04_3AVD_sig15() throws Exception + public void test04_15_3AVD_sig15() throws Exception { System.out.println("test04_3AVD_sig14"); @@ -2782,7 +2785,7 @@ public void test04_3AVD_sig15() throws Exception // test with minimal revocation information and all trust anchors @Test - public void test04_3AVD_ver1() throws Exception + public void test04_16_3AVD_ver1() throws Exception { System.out.println("test04_3AVD_ver1"); @@ -2837,7 +2840,7 @@ public void test04_3AVD_ver1() throws Exception // test with minimal revocation information and only some TSA trust anchors (minimal amount // that will still allow for successful history traversal) @Test - public void test04_3AVD_ver2() throws Exception + public void test04_17_3AVD_ver2() throws Exception { System.out.println("test04_3AVD_ver2"); @@ -2882,7 +2885,7 @@ public void test04_3AVD_ver2() throws Exception // removal of trust for all newest TSAs (gescape TSA is valid but don't provide CRL // for it) @Test(expected = CannotBuildCertificationPathException.class) - public void test04_3AVD_ver3() throws Exception + public void test04_18_3AVD_ver3() throws Exception { System.out.println("test04_3AVD_ver3"); @@ -2925,7 +2928,7 @@ public void test04_3AVD_ver3() throws Exception // test with minimal revocation information and only some TSA trust anchors // removal of trust for all newest TSAs, but provide CRL for gescape @Test - public void test04_3AVD_ver4() throws Exception + public void test04_19_3AVD_ver4() throws Exception { System.out.println("test04_3AVD_ver3"); From bd7bcb8032ccee0420334162d297802d7b946d83 Mon Sep 17 00:00:00 2001 From: Leandro Souza Costa Date: Thu, 18 Aug 2016 13:25:03 -0300 Subject: [PATCH 75/84] Remove DO_BREAK_LINES from Base64 marshaller --- src/main/java/xades4j/xml/bind/Base64XmlAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/xades4j/xml/bind/Base64XmlAdapter.java b/src/main/java/xades4j/xml/bind/Base64XmlAdapter.java index ac15a65f..0314627e 100644 --- a/src/main/java/xades4j/xml/bind/Base64XmlAdapter.java +++ b/src/main/java/xades4j/xml/bind/Base64XmlAdapter.java @@ -23,7 +23,7 @@ public byte[] unmarshal(String value) throws Exception { @Override public String marshal(byte[] value) throws IOException { - return (xades4j.utils.Base64.encodeBytes(value, xades4j.utils.Base64.DO_BREAK_LINES)); + return (xades4j.utils.Base64.encodeBytes(value/*, xades4j.utils.Base64.DO_BREAK_LINES*/)); } } From bb5ccdd43f8b005cdceb7b0797fe18890d2a5201 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Fri, 15 Jul 2016 15:01:16 -0300 Subject: [PATCH 76/84] Update bouncycastle and adds support for proxy configuration in tests --- pom.xml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 8511d9a3..dbab7782 100644 --- a/pom.xml +++ b/pom.xml @@ -64,16 +64,39 @@ org.bouncycastle bcpkix-jdk15on - 1.50 + 1.54 org.bouncycastle bcprov-jdk15on - 1.50 + 1.54 - + + + test-with-proxy + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + http.proxyHost + ${http.proxyHost} + + + http.proxyPort + ${http.proxyPort} + + + + + + + release From b25e9dd98f6f2e809a88c3255d008067f4a4f7d6 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Thu, 18 Aug 2016 13:38:09 -0300 Subject: [PATCH 77/84] Prepare sun-jax.episode for external usage --- .../META-INF/sun-jaxb.episode | 152 +++++++++--------- 1 file changed, 76 insertions(+), 76 deletions(-) rename src/main/{java => resources}/META-INF/sun-jaxb.episode (56%) diff --git a/src/main/java/META-INF/sun-jaxb.episode b/src/main/resources/META-INF/sun-jaxb.episode similarity index 56% rename from src/main/java/META-INF/sun-jaxb.episode rename to src/main/resources/META-INF/sun-jaxb.episode index 914ecf41..f60f7aa6 100644 --- a/src/main/java/META-INF/sun-jaxb.episode +++ b/src/main/resources/META-INF/sun-jaxb.episode @@ -8,231 +8,231 @@ Any modifications to this file will be lost upon recompilation of the source sch Generated on: 2011.08.02 at 08:48:59 PM BST --> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + From 1272a69aca821dd69681b352594b10529e31476f Mon Sep 17 00:00:00 2001 From: Leandro Souza Costa Date: Fri, 16 Sep 2016 08:44:31 -0300 Subject: [PATCH 78/84] Select the right certificate from ds:KeyInfo --- .../xades4j/verification/SignatureUtils.java | 796 +++++++++--------- 1 file changed, 395 insertions(+), 401 deletions(-) diff --git a/src/main/java/xades4j/verification/SignatureUtils.java b/src/main/java/xades4j/verification/SignatureUtils.java index af836920..6e95f459 100644 --- a/src/main/java/xades4j/verification/SignatureUtils.java +++ b/src/main/java/xades4j/verification/SignatureUtils.java @@ -1,402 +1,396 @@ -/* - * XAdES4j - A Java library for generation and verification of XAdES signatures. - * Copyright (C) 2010 Luis Goncalves. +/* + * XAdES4j - A Java library for generation and verification of XAdES signatures. + * Copyright (C) 2010 Luis Goncalves. * Copyrigth (C) 2012 Hubert Kario - QBS. - * - * XAdES4j is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 3 of the License, or any later version. - * - * XAdES4j is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License along - * with XAdES4j. If not, see . - */ -package xades4j.verification; - -import java.security.cert.X509CertSelector; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import javax.security.auth.x500.X500Principal; -import org.apache.xml.security.exceptions.XMLSecurityException; -import org.apache.xml.security.keys.KeyInfo; -import org.apache.xml.security.keys.content.X509Data; -import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial; -import org.apache.xml.security.signature.Reference; -import org.apache.xml.security.signature.SignedInfo; -import org.apache.xml.security.signature.XMLSignature; -import org.apache.xml.security.signature.XMLSignatureException; -import org.apache.xml.security.transforms.Transforms; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import xades4j.XAdES4jXMLSigException; -import xades4j.algorithms.GenericAlgorithm; -import xades4j.properties.QualifyingProperty; -import xades4j.providers.CertificateValidationException; -import xades4j.utils.DOMHelper; - -/** - * - * @author Luís - */ -class SignatureUtils -{ - - private SignatureUtils() - { - } - /**/ - - /** - * Unique identifier of key used for Signature - */ - static class KeyInfoRes - { - - List keyInfoCerts; - X509CertSelector certSelector; - XMLX509IssuerSerial issuerSerial; - - KeyInfoRes( - List keyInfoCerts, - X509CertSelector certSelector, - XMLX509IssuerSerial issuerSerial) - { - this.keyInfoCerts = keyInfoCerts; - this.certSelector = certSelector; - this.issuerSerial = issuerSerial; - } - } - - static KeyInfoRes processKeyInfo( - KeyInfo keyInfo) throws CertificateValidationException - { - if (null == keyInfo || !keyInfo.containsX509Data()) - { - throw new InvalidKeyInfoDataException("No X509Data to identify the leaf certificate"); - } - - List keyInfoCerts = new ArrayList(1); - XMLX509IssuerSerial issuerSerial = null; - X509CertSelector certSelector = new X509CertSelector(); - - // XML-DSIG 4.4.4: "Any X509IssuerSerial, X509SKI, and X509SubjectName elements - // that appear MUST refer to the certificate or certificates containing the - // validation key." - // "All certificates appearing in an X509Data element MUST relate to the - // validation key by either containing it or being part of a certification - // chain that terminates in a certificate containing the validation key". - - // Scan ds:X509Data to find ds:IssuerSerial or ds:SubjectName elements. The - // first to be found is used to select the leaf certificate. If none of those - // elements is present, the first ds:X509Certificate is assumed as the signing - // certificate. - boolean hasSelectionCriteria = false; - - try - { - for (int i = 0; i < keyInfo.lengthX509Data(); ++i) - { - X509Data x509Data = keyInfo.itemX509Data(i); - - if(!hasSelectionCriteria) - { - if (x509Data.containsIssuerSerial()) - { - issuerSerial = x509Data.itemIssuerSerial(0); - certSelector.setIssuer(new X500Principal(issuerSerial.getIssuerName())); - certSelector.setSerialNumber(issuerSerial.getSerialNumber()); - hasSelectionCriteria = true; - } - else if (x509Data.containsSubjectName()) - { - certSelector.setSubject(new X500Principal(x509Data.itemSubjectName(0).getSubjectName())); - hasSelectionCriteria = true; - } - } - - // Collect all certificates as they may be needed to build the cert path. - if (x509Data.containsCertificate()) - { - for (int j = 0; j < x509Data.lengthCertificate(); ++j) - { - keyInfoCerts.add(x509Data.itemCertificate(j).getX509Certificate()); - } - } - } - - if(!hasSelectionCriteria) - { - if(keyInfoCerts.isEmpty()) - { - // No criteria to select the leaf certificate. - // Improvement: search the SigningCertiticate property and try to - // find the "bottom" certificate. - throw new InvalidKeyInfoDataException("No criteria to select the leaf certificate"); - } - certSelector.setCertificate(keyInfoCerts.get(0)); - } - } - catch (XMLSecurityException ex) - { - throw new InvalidKeyInfoDataException("Cannot process X509Data", ex); - } - - return new KeyInfoRes(keyInfoCerts, certSelector, issuerSerial); - } - - /**************************************************************************/ - static class ReferencesRes - { - - /** - * In signature order. - */ - List dataObjsReferences; - Reference signedPropsReference; - - ReferencesRes( - List dataObjsReferences, - Reference signedPropsReference) - { - this.dataObjsReferences = Collections.unmodifiableList(dataObjsReferences); - this.signedPropsReference = signedPropsReference; - } - } - - /** - * Extracts references to signed properties and signed data objects from provided - * signature. - * @param signature - * @return - * @throws QualifyingPropertiesIncorporationException - * @throws XAdES4jXMLSigException - */ - static ReferencesRes processReferences( - XMLSignature signature) throws QualifyingPropertiesIncorporationException, XAdES4jXMLSigException - { - SignedInfo signedInfo = signature.getSignedInfo(); - - List dataObjsReferences = new ArrayList(signedInfo.getLength() - 1); - Reference signedPropsRef = null; - - for (int i = 0; i < signedInfo.getLength(); i++) - { - Reference ref; - try - { - ref = signedInfo.item(i); - } catch (XMLSecurityException ex) - { - throw new XAdES4jXMLSigException(String.format("Cannot process the %dth reference", i), ex); - } - - String refTypeUri = ref.getType(); - - // XAdES 6.3.1: "In order to protect the properties with the signature, - // a ds:Reference element MUST be added to the XMLDSIG signature (...) - // composed in such a way that it uses the SignedProperties element (...) - // as the input for computing its corresponding digest. Additionally, - // (...) use the Type attribute of this particular ds:Reference element, - // with its value set to: http://uri.etsi.org/01903#SignedProperties." - if (QualifyingProperty.SIGNED_PROPS_TYPE_URI.equals(refTypeUri)) - { - if (signedPropsRef != null) - { - throw new QualifyingPropertiesIncorporationException("Multiple references to SignedProperties"); - } - signedPropsRef = ref; - } else - { - RawDataObjectDesc dataObj = new RawDataObjectDesc(ref); - dataObjsReferences.add(dataObj); - try - { - Transforms transfs = ref.getTransforms(); - if (transfs != null) - { - for (int j = 0; j < transfs.getLength(); ++j) - { - dataObj.withTransform(new GenericAlgorithm(transfs.item(j).getURI())); - } - } - } catch (XMLSecurityException ex) - { - throw new XAdES4jXMLSigException("Cannot process transfroms", ex); - } - - } - } - - if (null == signedPropsRef) - // !!! - // Still may be a XAdES signature, if the signing certificate is - // protected. For now, that scenario is not supported. - { - throw new QualifyingPropertiesIncorporationException("SignedProperties reference not found"); - } - - return new ReferencesRes(dataObjsReferences, signedPropsRef); - } - - /***************************************************************************/ - static Element getQualifyingPropertiesElement(XMLSignature signature) throws QualifyingPropertiesIncorporationException - { - boolean foundXAdESContainerObject = false; - Element qualifyingPropsElem = null; - - for (int i = 0; i < signature.getObjectLength(); ++i) - { - Element objElem = signature.getObjectItem(i).getElement(); - Collection xadesElems = getXAdESChildElements(objElem); - - if (!xadesElems.isEmpty()) - { - // XAdES 6.3: "all instances of the QualifyingProperties and the - // QualifyingPropertiesReference elements MUST occur within a single - // ds:Object element". This could be tested with qualifyingPropsNode - // because I'm only supporting QualifyingProperties. Anyway, the - // exception message is more specific this way. - if (foundXAdESContainerObject) - { - throw new QualifyingPropertiesIncorporationException("All instances of the QualifyingProperties element must occur within a single ds:Object element"); - } - - // If this Object had XAdES elements, it is "the Object". The for - // cycle over the Objects is not interrupted because I need to - // check the correct incorporation of properties (XAdES G.2.2.1). - foundXAdESContainerObject = true; - - for (Element e : xadesElems) - { - if (e.getLocalName().equals(QualifyingProperty.QUALIFYING_PROPS_TAG)) - { - // XAdES 6.3: "at most one instance of the QualifyingProperties - // element MAY occur within this ds:Object element". - if (qualifyingPropsElem != null) - { - throw new QualifyingPropertiesIncorporationException("Only a single QualifyingProperties element is allowed inside the ds:Object element"); - } - qualifyingPropsElem = e; - - } else - // QualifyingPropertiesReference is not supported, so - // nothing else on this namespace should appear. - { - throw new QualifyingPropertiesIncorporationException("Only the QualifyingProperties element is supported"); - } - } - } - } - - if (!foundXAdESContainerObject) - { - throw new QualifyingPropertiesIncorporationException("Couldn't find any XAdES elements"); - } - - return qualifyingPropsElem; - } - - private static Collection getXAdESChildElements( - Element xmlObjectElem) - { - Collection xadesElems = new ArrayList(1); - - Node child = xmlObjectElem.getFirstChild(); - while (child != null) - { - if (child.getNodeType() == Node.ELEMENT_NODE && QualifyingProperty.XADES_XMLNS.equals(child.getNamespaceURI())) - { - xadesElems.add((Element) child); - } - child = child.getNextSibling(); - } - - return xadesElems; - } - - /** - * Check if signedProperties are properly embedded in qualifying properties element - * @param qualifyingPropsElem - * @param signedPropsRef - * @throws QualifyingPropertiesIncorporationException - */ - static void checkSignedPropertiesIncorporation(Element qualifyingPropsElem, Reference signedPropsRef) throws QualifyingPropertiesIncorporationException - { - Element signedPropsElem = DOMHelper.getFirstChildElement(qualifyingPropsElem); - if (signedPropsElem == null - || !signedPropsElem.getLocalName().equals(QualifyingProperty.SIGNED_PROPS_TAG) - || !signedPropsElem.getNamespaceURI().equals(QualifyingProperty.XADES_XMLNS)) - { - throw new QualifyingPropertiesIncorporationException("SignedProperties not found as the first child of QualifyingProperties."); - } - - DOMHelper.useIdAsXmlId(signedPropsElem); - - // Only QualifyingProperties in the signature's document are supported. - // XML-DSIG 4.3.3.2: "a same-document reference is defined as a URI-Reference - // that consists of a hash sign ('#') followed by a fragment" - if (!signedPropsRef.getURI().startsWith("#")) - { - throw new QualifyingPropertiesIncorporationException("Only QualifyingProperties in the signature's document are supported"); - } - - try - { - Node sPropsNode = signedPropsRef.getNodesetBeforeFirstCanonicalization().getSubNode(); - if (sPropsNode == null || sPropsNode.getNodeType() != Node.ELEMENT_NODE) - { - throw new QualifyingPropertiesIncorporationException("The supposed reference over signed properties doesn't cover an element."); - } - - // The referenced signed properties element must be the child of qualifying properties. - Element referencedSignedPropsElem = (Element) sPropsNode; - if (referencedSignedPropsElem != signedPropsElem) - { - throw new QualifyingPropertiesIncorporationException("The referenced SignedProperties are not contained by the proper QualifyingProperties element"); - } - } catch (XMLSignatureException ex) - { - throw new QualifyingPropertiesIncorporationException("Cannot get the referenced SignedProperties", ex); - } - } - - /** - * Checks if QualifyingProperties references provided Signature - * @param signatureId - * @param qualifyingPropsElem - * @throws QualifyingPropertiesIncorporationException - */ - public static void checkQualifyingPropertiesTarget(String signatureId, - Element qualifyingPropsElem) - throws QualifyingPropertiesIncorporationException - { - Node targetAttr = qualifyingPropsElem.getAttributeNodeNS(null, - QualifyingProperty.TARGET_ATTR); - if (null == targetAttr) - { - targetAttr = qualifyingPropsElem.getAttributeNodeNS( - QualifyingProperty.XADES_XMLNS, - QualifyingProperty.TARGET_ATTR); - if (null == targetAttr) - { - throw new QualifyingPropertiesIncorporationException( - "QualifyingProperties Target attribute not present"); - } - } - String targetValue = targetAttr.getNodeValue(); - if (null == targetValue - || !targetValue.startsWith("#") - || !targetValue.substring(1).equals(signatureId)) - { - throw new QualifyingPropertiesIncorporationException( - "QualifyingProperties target doesn't match the signature's Id"); - } - } -} + * + * XAdES4j is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or any later version. + * + * XAdES4j is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with XAdES4j. If not, see . + */ +package xades4j.verification; + +import java.security.PublicKey; +import java.security.cert.X509CertSelector; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import javax.security.auth.x500.X500Principal; +import org.apache.xml.security.exceptions.XMLSecurityException; +import org.apache.xml.security.keys.KeyInfo; +import org.apache.xml.security.keys.content.X509Data; +import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial; +import org.apache.xml.security.signature.Reference; +import org.apache.xml.security.signature.SignedInfo; +import org.apache.xml.security.signature.XMLSignature; +import org.apache.xml.security.signature.XMLSignatureException; +import org.apache.xml.security.transforms.Transforms; +import org.bouncycastle.asn1.DEROctetString; +import org.bouncycastle.asn1.x509.AuthorityKeyIdentifier; +import org.bouncycastle.asn1.x509.SubjectKeyIdentifier; +import org.bouncycastle.util.encoders.Hex; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import xades4j.XAdES4jXMLSigException; +import xades4j.algorithms.GenericAlgorithm; +import xades4j.properties.QualifyingProperty; +import xades4j.providers.CertificateValidationException; +import xades4j.utils.DOMHelper; + +/** + * + * @author Luís + */ +class SignatureUtils { + + private SignatureUtils() { + } + /**/ + + /** + * Unique identifier of key used for Signature + */ + static class KeyInfoRes { + + List keyInfoCerts; + X509CertSelector certSelector; + XMLX509IssuerSerial issuerSerial; + + KeyInfoRes(List keyInfoCerts, X509CertSelector certSelector, + XMLX509IssuerSerial issuerSerial) { + this.keyInfoCerts = keyInfoCerts; + this.certSelector = certSelector; + this.issuerSerial = issuerSerial; + } + } + + static KeyInfoRes processKeyInfo(KeyInfo keyInfo) throws CertificateValidationException { + if (null == keyInfo || !keyInfo.containsX509Data()) { + throw new InvalidKeyInfoDataException("No X509Data to identify the leaf certificate"); + } + + List keyInfoCerts = new ArrayList(1); + XMLX509IssuerSerial issuerSerial = null; + X509CertSelector certSelector = new X509CertSelector(); + + // XML-DSIG 4.4.4: "Any X509IssuerSerial, X509SKI, and X509SubjectName + // elements + // that appear MUST refer to the certificate or certificates containing + // the + // validation key." + // "All certificates appearing in an X509Data element MUST relate to the + // validation key by either containing it or being part of a + // certification + // chain that terminates in a certificate containing the validation + // key". + + // Scan ds:X509Data to find ds:IssuerSerial or ds:SubjectName elements. + // The + // first to be found is used to select the leaf certificate. If none of + // those + // elements is present, the first ds:X509Certificate is assumed as the + // signing + // certificate. + boolean hasSelectionCriteria = false; + + try { + for (int i = 0; i < keyInfo.lengthX509Data(); ++i) { + X509Data x509Data = keyInfo.itemX509Data(i); + + if (!hasSelectionCriteria) { + if (x509Data.containsIssuerSerial()) { + issuerSerial = x509Data.itemIssuerSerial(0); + certSelector.setIssuer(new X500Principal(issuerSerial.getIssuerName())); + certSelector.setSerialNumber(issuerSerial.getSerialNumber()); + hasSelectionCriteria = true; + } else if (x509Data.containsSubjectName()) { + certSelector.setSubject(new X500Principal(x509Data.itemSubjectName(0).getSubjectName())); + hasSelectionCriteria = true; + } + } + + // Collect all certificates as they may be needed to build the + // cert path. + if (x509Data.containsCertificate()) { + for (int j = 0; j < x509Data.lengthCertificate(); ++j) { + keyInfoCerts.add(x509Data.itemCertificate(j).getX509Certificate()); + } + } + } + + if (!hasSelectionCriteria) { + if (keyInfoCerts.isEmpty()) { + // No criteria to select the leaf certificate. + // Improvement: search the SigningCertiticate property and + // try to + // find the "bottom" certificate. + throw new InvalidKeyInfoDataException("No criteria to select the leaf certificate"); + } + + keyInfoCerts.sort(new Comparator() { + @Override + public int compare(X509Certificate cert1, X509Certificate cert2) { + try { + cert1.verify(cert2.getPublicKey()); + return -1; + } catch (Throwable t) { + try { + cert2.verify(cert1.getPublicKey()); + return 1; + } catch (Throwable t2) { + return 0; + } + } + } + }); + certSelector.setCertificate(keyInfoCerts.get(0)); + } + } catch (XMLSecurityException ex) { + throw new InvalidKeyInfoDataException("Cannot process X509Data", ex); + } + + return new KeyInfoRes(keyInfoCerts, certSelector, issuerSerial); + } + + /**************************************************************************/ + static class ReferencesRes { + + /** + * In signature order. + */ + List dataObjsReferences; + Reference signedPropsReference; + + ReferencesRes(List dataObjsReferences, Reference signedPropsReference) { + this.dataObjsReferences = Collections.unmodifiableList(dataObjsReferences); + this.signedPropsReference = signedPropsReference; + } + } + + /** + * Extracts references to signed properties and signed data objects from + * provided signature. + * + * @param signature + * @return + * @throws QualifyingPropertiesIncorporationException + * @throws XAdES4jXMLSigException + */ + static ReferencesRes processReferences(XMLSignature signature) + throws QualifyingPropertiesIncorporationException, XAdES4jXMLSigException { + SignedInfo signedInfo = signature.getSignedInfo(); + + List dataObjsReferences = new ArrayList(signedInfo.getLength() - 1); + Reference signedPropsRef = null; + + for (int i = 0; i < signedInfo.getLength(); i++) { + Reference ref; + try { + ref = signedInfo.item(i); + } catch (XMLSecurityException ex) { + throw new XAdES4jXMLSigException(String.format("Cannot process the %dth reference", i), ex); + } + + String refTypeUri = ref.getType(); + + // XAdES 6.3.1: "In order to protect the properties with the + // signature, + // a ds:Reference element MUST be added to the XMLDSIG signature + // (...) + // composed in such a way that it uses the SignedProperties element + // (...) + // as the input for computing its corresponding digest. + // Additionally, + // (...) use the Type attribute of this particular ds:Reference + // element, + // with its value set to: + // http://uri.etsi.org/01903#SignedProperties." + if (QualifyingProperty.SIGNED_PROPS_TYPE_URI.equals(refTypeUri)) { + if (signedPropsRef != null) { + throw new QualifyingPropertiesIncorporationException("Multiple references to SignedProperties"); + } + signedPropsRef = ref; + } else { + RawDataObjectDesc dataObj = new RawDataObjectDesc(ref); + dataObjsReferences.add(dataObj); + try { + Transforms transfs = ref.getTransforms(); + if (transfs != null) { + for (int j = 0; j < transfs.getLength(); ++j) { + dataObj.withTransform(new GenericAlgorithm(transfs.item(j).getURI())); + } + } + } catch (XMLSecurityException ex) { + throw new XAdES4jXMLSigException("Cannot process transfroms", ex); + } + + } + } + + if (null == signedPropsRef) + // !!! + // Still may be a XAdES signature, if the signing certificate is + // protected. For now, that scenario is not supported. + { + throw new QualifyingPropertiesIncorporationException("SignedProperties reference not found"); + } + + return new ReferencesRes(dataObjsReferences, signedPropsRef); + } + + /***************************************************************************/ + static Element getQualifyingPropertiesElement(XMLSignature signature) + throws QualifyingPropertiesIncorporationException { + boolean foundXAdESContainerObject = false; + Element qualifyingPropsElem = null; + + for (int i = 0; i < signature.getObjectLength(); ++i) { + Element objElem = signature.getObjectItem(i).getElement(); + Collection xadesElems = getXAdESChildElements(objElem); + + if (!xadesElems.isEmpty()) { + // XAdES 6.3: "all instances of the QualifyingProperties and the + // QualifyingPropertiesReference elements MUST occur within a + // single + // ds:Object element". This could be tested with + // qualifyingPropsNode + // because I'm only supporting QualifyingProperties. Anyway, the + // exception message is more specific this way. + if (foundXAdESContainerObject) { + throw new QualifyingPropertiesIncorporationException( + "All instances of the QualifyingProperties element must occur within a single ds:Object element"); + } + + // If this Object had XAdES elements, it is "the Object". The + // for + // cycle over the Objects is not interrupted because I need to + // check the correct incorporation of properties (XAdES + // G.2.2.1). + foundXAdESContainerObject = true; + + for (Element e : xadesElems) { + if (e.getLocalName().equals(QualifyingProperty.QUALIFYING_PROPS_TAG)) { + // XAdES 6.3: "at most one instance of the + // QualifyingProperties + // element MAY occur within this ds:Object element". + if (qualifyingPropsElem != null) { + throw new QualifyingPropertiesIncorporationException( + "Only a single QualifyingProperties element is allowed inside the ds:Object element"); + } + qualifyingPropsElem = e; + + } else + // QualifyingPropertiesReference is not supported, so + // nothing else on this namespace should appear. + { + throw new QualifyingPropertiesIncorporationException( + "Only the QualifyingProperties element is supported"); + } + } + } + } + + if (!foundXAdESContainerObject) { + throw new QualifyingPropertiesIncorporationException("Couldn't find any XAdES elements"); + } + + return qualifyingPropsElem; + } + + private static Collection getXAdESChildElements(Element xmlObjectElem) { + Collection xadesElems = new ArrayList(1); + + Node child = xmlObjectElem.getFirstChild(); + while (child != null) { + if (child.getNodeType() == Node.ELEMENT_NODE + && QualifyingProperty.XADES_XMLNS.equals(child.getNamespaceURI())) { + xadesElems.add((Element) child); + } + child = child.getNextSibling(); + } + + return xadesElems; + } + + /** + * Check if signedProperties are properly embedded in qualifying properties + * element + * + * @param qualifyingPropsElem + * @param signedPropsRef + * @throws QualifyingPropertiesIncorporationException + */ + static void checkSignedPropertiesIncorporation(Element qualifyingPropsElem, Reference signedPropsRef) + throws QualifyingPropertiesIncorporationException { + Element signedPropsElem = DOMHelper.getFirstChildElement(qualifyingPropsElem); + if (signedPropsElem == null || !signedPropsElem.getLocalName().equals(QualifyingProperty.SIGNED_PROPS_TAG) + || !signedPropsElem.getNamespaceURI().equals(QualifyingProperty.XADES_XMLNS)) { + throw new QualifyingPropertiesIncorporationException( + "SignedProperties not found as the first child of QualifyingProperties."); + } + + DOMHelper.useIdAsXmlId(signedPropsElem); + + // Only QualifyingProperties in the signature's document are supported. + // XML-DSIG 4.3.3.2: "a same-document reference is defined as a + // URI-Reference + // that consists of a hash sign ('#') followed by a fragment" + if (!signedPropsRef.getURI().startsWith("#")) { + throw new QualifyingPropertiesIncorporationException( + "Only QualifyingProperties in the signature's document are supported"); + } + + try { + Node sPropsNode = signedPropsRef.getNodesetBeforeFirstCanonicalization().getSubNode(); + if (sPropsNode == null || sPropsNode.getNodeType() != Node.ELEMENT_NODE) { + throw new QualifyingPropertiesIncorporationException( + "The supposed reference over signed properties doesn't cover an element."); + } + + // The referenced signed properties element must be the child of + // qualifying properties. + Element referencedSignedPropsElem = (Element) sPropsNode; + if (referencedSignedPropsElem != signedPropsElem) { + throw new QualifyingPropertiesIncorporationException( + "The referenced SignedProperties are not contained by the proper QualifyingProperties element"); + } + } catch (XMLSignatureException ex) { + throw new QualifyingPropertiesIncorporationException("Cannot get the referenced SignedProperties", ex); + } + } + + /** + * Checks if QualifyingProperties references provided Signature + * + * @param signatureId + * @param qualifyingPropsElem + * @throws QualifyingPropertiesIncorporationException + */ + public static void checkQualifyingPropertiesTarget(String signatureId, Element qualifyingPropsElem) + throws QualifyingPropertiesIncorporationException { + Node targetAttr = qualifyingPropsElem.getAttributeNodeNS(null, QualifyingProperty.TARGET_ATTR); + if (null == targetAttr) { + targetAttr = qualifyingPropsElem.getAttributeNodeNS(QualifyingProperty.XADES_XMLNS, + QualifyingProperty.TARGET_ATTR); + if (null == targetAttr) { + throw new QualifyingPropertiesIncorporationException( + "QualifyingProperties Target attribute not present"); + } + } + String targetValue = targetAttr.getNodeValue(); + if (null == targetValue || !targetValue.startsWith("#") || !targetValue.substring(1).equals(signatureId)) { + throw new QualifyingPropertiesIncorporationException( + "QualifyingProperties target doesn't match the signature's Id"); + } + } +} From 282d3029f763347915e60232d4dbc98d627bfed1 Mon Sep 17 00:00:00 2001 From: Leandro Souza Costa Date: Fri, 23 Sep 2016 12:46:43 -0300 Subject: [PATCH 79/84] Add custom unsigned properties to ArchiveTimeStamp digest --- .../xades4j/verification/ArchiveTimeStampVerifier.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java index b1661864..8e32526b 100644 --- a/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java +++ b/src/main/java/xades4j/verification/ArchiveTimeStampVerifier.java @@ -225,7 +225,13 @@ protected BaseXAdESTimeStampProperty addPropSpecificTimeStampInputAndCreatePrope TimeStampValidationDataProperty.class)) { digestInput.addNode(elem); - }// else: ignore other properties + } else { + // TS 101 903 V1.4.1 defined new unsigned properties making use + // of the extension mechanism specified in + // xades:UnsignedSignatureProperties, namely the element. + digestInput.addNode(elem); + } } /* take "all the ds:Object elements different to the one From ad41df42cf1c1bd1671d4429add88e98ce3cd7cc Mon Sep 17 00:00:00 2001 From: Leandro Souza Costa Date: Mon, 21 Nov 2016 11:54:04 -0200 Subject: [PATCH 80/84] Close files after adding to FileSystemDirectoryCertStore --- .../utils/FileSystemDirectoryCertStore.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/main/java/xades4j/utils/FileSystemDirectoryCertStore.java b/src/main/java/xades4j/utils/FileSystemDirectoryCertStore.java index 519ef249..e6c826b3 100644 --- a/src/main/java/xades4j/utils/FileSystemDirectoryCertStore.java +++ b/src/main/java/xades4j/utils/FileSystemDirectoryCertStore.java @@ -19,6 +19,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import java.security.InvalidAlgorithmParameterException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; @@ -162,16 +164,20 @@ private void transverseDirToFindContent( if (f.isDirectory()) transverseDirToFindContent(f, contentList, certsFilesExts, crlsFilesExts, cf); else if (f.isFile()) - try - { - if (hasExt(f, certsFilesExts)) - contentList.add((X509Certificate)cf.generateCertificate(new FileInputStream(f))); - else if (hasExt(f, crlsFilesExts)) - contentList.add((X509CRL)cf.generateCRL(new FileInputStream(f))); - } catch (FileNotFoundException ex) - { - // The file existed right up there! If somehow it doesn't exist - // now, nevermind. + if (hasExt(f, certsFilesExts)) { + try (InputStream is = new FileInputStream(f)) { + contentList.add((X509Certificate) cf.generateCertificate(is)); + } catch (IOException e) { + // The file existed and somehow it doesn't exist now, or + // it was not possible to close is, nevermind. + } + } else if (hasExt(f, crlsFilesExts)) { + try (InputStream is = new FileInputStream(f)) { + contentList.add((X509CRL) cf.generateCRL(is)); + } catch (IOException e) { + // The file existed and somehow it doesn't exist now, or + // it was not possible to close is, nevermind. + } } } } From 9732eaa7c7960c93f6082a625217cd389faed735 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Mon, 6 Feb 2017 15:32:06 -0200 Subject: [PATCH 81/84] Update test tstoken, crls and xmls --- src/test/cert/gva/raizaccv1_der.crl | Bin 705 -> 705 bytes .../cert/gva/raizaccv1_der_29_11_2016.crl | Bin 0 -> 705 bytes ...r_0\342\200\2162\342\200\216_05_2011 .crl" | Bin src/test/cert/gva/trustAnchor | Bin 3783 -> 3783 bytes .../DefaultTimeStampTokenProviderTest.java | 17 + src/test/java/xades4j/providers/impl/tstoken | Bin 3916 -> 5401 bytes src/test/xml/detached.bes.xml | 26 +- src/test/xml/detached.c.xml | 86 +---- src/test/xml/document.signed.bes.cs.xml | 36 +- src/test/xml/document.signed.bes.extres.xml | 86 +---- src/test/xml/document.signed.bes.xml | 160 +-------- src/test/xml/document.signed.c.xml | 86 +---- src/test/xml/document.signed.epes.xml | 18 +- src/test/xml/document.signed.t.bes.xml | 54 +-- src/test/xml/document.signed.t.epes.xml | 86 +---- src/test/xml/document.verified.c.x.xml | 180 +--------- src/test/xml/document.verified.c.xl.a.xml | 307 +----------------- src/test/xml/document.verified.c.xl.xml | 215 +----------- 18 files changed, 143 insertions(+), 1214 deletions(-) create mode 100644 src/test/cert/gva/raizaccv1_der_29_11_2016.crl rename "src/test/cert/gva/rootgva_der_\342\200\2162\342\200\216_05_2011 .crl" => "src/test/cert/gva/rootgva_der_0\342\200\2162\342\200\216_05_2011 .crl" (100%) diff --git a/src/test/cert/gva/raizaccv1_der.crl b/src/test/cert/gva/raizaccv1_der.crl index 623a4e315fa95142ebe9c4ea7e6136c0a09ba15e..4cb9fa18875a3f805839da8ad8a181dfaff1277e 100644 GIT binary patch delta 574 zcmV-E0>S;k1;GW7U>Y|tF)}tWH8MFeFVyF9sF#cXZYZB_aWMlTTu+ z{Ob9qE+Nx-U*fT=XZ}4t`L;ldH_QrY# zJVfN)^~@vUtvz`bX1Mk6KkEfmc8dd4yA4`tpq{eKPCnU4Jb1o;xUuKZ(+`j~6b?Da zZ&X#Vl&I!p;YJ0@j-{1!+TIqLGdL5a-KSk}SmmvJNMY8BjU8?_-ol-g&g}gpssw9 z^cPc2XHu^nwKH3PUs*)qge8mMD? Mh1Eqp^t%pM*V(WZ1poj5 delta 574 zcmV-E0>S;k1;GW7U>Y_sHZU?VGBY$XGFlf6F*Y$VGC46aGc+^zQ{7`IPgOV2PN8)CxqLb-en>~~5c zdk@q=)F#9hkDIU`_1^co)6_@ZY_O1RI-9ZSA^ zq>DT?+oih%FGfbxAW-I40Cc~AZqO?eg3|Uc% zmW#6gOoEsmGsY z=MHzlTYyaR_B|0>jLfC5cQ(;NF6k6a*^$6#SbP2bTtYDc^p3%rP^_~j+Ft6=nnPR!J=hrhcP%=_g{!Aq1NCX=uUeX42rktMLl!wZ>!Md@upu@ Mj5)1U^5LDR4`*r;bpQYW diff --git a/src/test/cert/gva/raizaccv1_der_29_11_2016.crl b/src/test/cert/gva/raizaccv1_der_29_11_2016.crl new file mode 100644 index 0000000000000000000000000000000000000000..623a4e315fa95142ebe9c4ea7e6136c0a09ba15e GIT binary patch literal 705 zcmXqLV%lraxQvOB(SVnYQ>)FR?K>|cBR4C9fs>(-fdCtGC<`+Wr=zoTSdgP%2{8*Ik89i6M&96qH(hjJHy>PU|5j>Z8i$gA+15p;e!hCH zv3KS1`DxGj$`3|2_DAuY08hb96WU9 z*V1DvCn)wcLu{^|=)KQ4<8?Xg@N`sv}^75o6)A}qH6 literal 0 HcmV?d00001 diff --git "a/src/test/cert/gva/rootgva_der_\342\200\2162\342\200\216_05_2011 .crl" "b/src/test/cert/gva/rootgva_der_0\342\200\2162\342\200\216_05_2011 .crl" similarity index 100% rename from "src/test/cert/gva/rootgva_der_\342\200\2162\342\200\216_05_2011 .crl" rename to "src/test/cert/gva/rootgva_der_0\342\200\2162\342\200\216_05_2011 .crl" diff --git a/src/test/cert/gva/trustAnchor b/src/test/cert/gva/trustAnchor index 721463e3d894a3f9b7b844286f487472a85804e9..9ebd3ff054660b80b5bae94cfb0fe554c23ee72a 100644 GIT binary patch delta 48 zcmX>udt7#cG;5Sd{`>Zg3TxPatO8b%%@^4ov5TzYRk-pk^sLx+O$N!U;qFB delta 48 zcmX>udt7#cG;8Sl=;nPJ71pqUSW7uJUu1j4E>fC!*wyUJq=#BA&-I<2o|yMI?yDC7 D1UVL% diff --git a/src/test/java/xades4j/providers/impl/DefaultTimeStampTokenProviderTest.java b/src/test/java/xades4j/providers/impl/DefaultTimeStampTokenProviderTest.java index 4347f3e6..42de4ae7 100644 --- a/src/test/java/xades4j/providers/impl/DefaultTimeStampTokenProviderTest.java +++ b/src/test/java/xades4j/providers/impl/DefaultTimeStampTokenProviderTest.java @@ -16,6 +16,10 @@ */ package xades4j.providers.impl; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; import org.apache.xml.security.algorithms.MessageDigestAlgorithm; import org.junit.Test; import static org.junit.Assert.*; @@ -40,7 +44,20 @@ public void testGetTimeStampToken() throws Exception assertNotNull(result); assertNotNull(result.encodedTimeStampToken); + //updateTestToken(result.encodedTimeStampToken); assertNotNull(result.timeStampTime); System.out.println(result.timeStampTime); } + + private void updateTestToken(byte[] encodedTimeStampToken) throws FileNotFoundException, IOException { + String tokenPath = "./src/test/java/" + this.getClass().getPackage().getName().replace('.', '/') + "/tstoken"; + File file = new File(tokenPath); + FileOutputStream is = new FileOutputStream(file); + try { + is.write(encodedTimeStampToken); + } finally { + is.close(); + } + + } } diff --git a/src/test/java/xades4j/providers/impl/tstoken b/src/test/java/xades4j/providers/impl/tstoken index f09c0d76acc8151004ba507492bab206168599aa..47adbeef934cf3d9d864d08a405ca6c500b1581d 100644 GIT binary patch literal 5401 zcmdT|2{=@3`#-Z71~bSm%akl*Jwr%ZZ1s{Q%aB(p8iT1}${LXjhEgPJBum~<(PD{; zXoMEZ8Y!X&J7>MU{zRV ztXUj_8<}$yW{M(_2o#AA#$vcs@hGGe7X&jAdKkVRPFO(%I){l+L^Bbqfk76DKw$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!;$ z7XsoHH<`9I2pfc2K|W$SdZ6;jnhPjKI0H_31-M8cao=x2#%=+huRD1dtdC6obSY3I zqAFipe-PczIysaIzS<|=WDujzS`rGjWxOTJi}%RQqjmC9mgO4TmV`b%7erb!p-O@> zDlJB&M-k~^1UO9Am26C^o2{^0Puwkp=V?!RbySE*w~{pSgguQl&RmsbPXiid<0Aj7 zIel{w5%OKPFX5lIFStQ~uU;tF;X+KroD-R5v>E#c>!HL`XWOoDQs}WCk2@_3)%BS5 zhd?^bG5X3j>ef3p_aokZL<=c*D$f@F-67K^O;SJ%Nj5~-G zy#{eP{{5%JH%IortE9*&olIU`p1SaXqQKo2+s1#boOw6V>l#hHU+ZRLlKmTFM&$b$ bI{pJj!QS_1A^AJF%~Qj!6;>#;Lg4ogzPr8z diff --git a/src/test/xml/detached.bes.xml b/src/test/xml/detached.bes.xml index 9c6f4ff7..45d91082 100644 --- a/src/test/xml/detached.bes.xml +++ b/src/test/xml/detached.bes.xml @@ -1,36 +1,36 @@ - + - + /collection/album/foo:tracks rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + /collection/album/bar:tracks/bar:song[@tracknumber = 1] N8H6u8UbT1bF40ELhV57g/PJppBg9pOXEiz/QuA6wrk= - + -0CAf5hH5cebOBuFsF74xF6cPNjw7GlYUU9b/U23uppc= +yDbbo1wh2gIsDCqjWrjbxDGE0BdKRhKdEpi5/OjMGjI= - + -exEZrq7PXJDHOXoE4DZO2bqqzmSUSZ6RDMmQEOaP2FE= +FnrFRfFT5hAVqpvd9/LlvrrslAd/RdIugOlvwqWed8Q= - -nhisKQ3DXqaPTmAEqpc9pZyXz1rLYnqewX+wFisPJ7P4EcI8sM0iGM0P5uS5kClhkPIO6c20yFPo -5pdx1S+hC1UTvrNvdMt+hs2d93DwIJmeYybCTNEcZgP+U6BCMveT1krrGkd9XdpY2hKN06nSN7kR -3JwCPN5SYXE4mHr2pfA= + +MB8+H3I0W0zPkhf9b53qZyBTMd/HH+GqQfanS8is+4Y2MSK/c2y9SJfVoCEqWHUwA5uayT2aF/TH +LWJ210+2EzHlBcJJT/IRzu5m+HYtbiSHc7e0UrvwaIcJf5I6I4TZXrmGvYQWQHulL6PQH4/c557Z +rr1DahMEznDT1XLTG9Q= - + MIICbTCCAdqgAwIBAgIQpkK0uals+ItHxBlpJuypOTAJBgUrDgMCHQUAMD8xCzAJBgNVBAYTAlBU @@ -47,5 +47,5 @@ Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== -2016-07-15T14:00:22.213-03:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869text/xml +2017-02-06T15:19:59.944-02:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869text/xml \ No newline at end of file diff --git a/src/test/xml/detached.c.xml b/src/test/xml/detached.c.xml index 516078f5..9a38bf0b 100644 --- a/src/test/xml/detached.c.xml +++ b/src/test/xml/detached.c.xml @@ -1,20 +1,20 @@ - + - + LPNKwDiu5awG+TPd0dqYJuC7k4PBPY4LCI/O0LSpW1s= - + -MdWUMgmWVkssbXvyf1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VQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZB -MScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmECBDtF5WgwDQYJKoZIhvcN -AQEBBQAEggEAZqQ3RHe15LcyVA7bM2MDEjAYHyKZRkGaCxi62L4ic8I7rfXo+gct0PouUsV2mQ+X -+QNFpMC+uKHAEhPEdYvABZCUwHlBLkbaXfmxXmG9FCChpPjvAntls5eHxxkVkVWQx49IDTpyWmjm -qn5Br6xYCzKcY+aPtfgaNSsQBpd1qBhehFeRlvG9wEf5Y1agXagGX7cJPc8wfPKampgqCezLf2gs -DM27omlKHC6XTvB/MP/P6HH5LZ//FI2OQudTK/5P738G07R3TcF7b6LVqHUXs/m0m/6W8qVJC3sp -bSq+J1BPpRchFPbGM8EVO51NNjgvXjL4k82cVvAmviCFDQsyQgAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12: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aoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001 \ No newline at end of file diff --git a/src/test/xml/document.signed.bes.cs.xml b/src/test/xml/document.signed.bes.cs.xml index 72758057..e39d5450 100644 --- a/src/test/xml/document.signed.bes.cs.xml +++ b/src/test/xml/document.signed.bes.cs.xml @@ -26,26 +26,26 @@ - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -pfrrRjkGNPiRF2Bjuj3IJTGSEFYc2PDs6FCNAUJOu8E= +xZEYSpzc7i/0nQ0s7P4N9sOzFpLUvP4/RXstelh9VSs= - -Vb/2ay4rX9cytiRCmBkgRkE4d0E05nkM412CwOHvTagCXPZZ2B2ifbmrQznTEU6Jz0dF65j5kU7C -bYK+9fMKB0lmqx2kUdWeBa30Rl/3ELKWKOLeDFN91zC3q4a6dtzQGwBidWex+2dO8Z69sBd2aTS6 -S6nyGs53kTspDHfBeyg= + +hFAXNfsTOgO6dICHSH+/pjnIfHkPyJTGZ6yonVJC5Z9BwxNGbTnJHbwSHScZgMMl3XQcyzreqBIn +64k8WkPQj8bpz/3LpKuVxU6T/fmNqiQ1sCz6lJQQPLZWGB3JZINOUgZMrNt5kyt7Sm/yzK7ldJ4R +BhaJHCE8/CjZoq3bSZU= @@ -64,23 +64,23 @@ Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== -4btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869CounterSignature maniac +4btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869CounterSignature maniac - + -Nr5JKCScyqjKWneJw2AC6YmdU/2JZA5Pj40fkVCFbL4= +1beHuwu4eWbtenZbo12JwTq/UMVjFe0jzd4VbmXvfSk= - + -PJWDlPFdx4TJ5AXT3nIbFa2euboYGM7bpuBmol4nKSQ= +st13c9/4E9J4F3CVg00e16Sk4PtFL70aSk73v6B9Bd8= - -MCcli4l5rAsGeJX2gOmoYDIAXnbszmRwOH94y7kHnpxCwGwoVrCaLSONtgKEy8mj9Ehqa/R5Dj5g -DgC77VkNIaRKD613JMnbsaqZ7PD0iVivLvBkasTch4PX92UEbk8EvCgzxvhlgN+L6zSLsv65sFcR -lFUGluMtzrqlDKvts38= + +WUlk+RW1vw8babYeqYedwRudkcac5J2L5PyZVFRYHVi9Pg6OiM9Vwea0rR7G4pj4LvGEmrcrGtr5 +gcN7qTWh3+3cdRdmgMLX2OWhMOpb4xDXCreXV9t5KX7e8p2Iv0bf77aKC4MN0cQqW3I2/UldsuJM +JFxk0U1sSW8KobFMUP0= @@ -99,6 +99,6 @@ Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== -2012-10-13T14:26:18.783+01:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869 +2017-02-06T15:20:05.160-02:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869 \ No newline at end of file diff --git a/src/test/xml/document.signed.bes.extres.xml b/src/test/xml/document.signed.bes.extres.xml index fcb6482e..49758911 100644 --- a/src/test/xml/document.signed.bes.extres.xml +++ b/src/test/xml/document.signed.bes.extres.xml @@ -1,20 +1,20 @@ - + - + Of0XZE/y1lS8g4FKeLHFtedRf0lnQfNOrVBklD65gkA= - + -b71fJDmSMU8nYLIpUXOAmSRrhcLmrqpIOhfeJs51Upw= +kytFQIjyblojtkUqIJuybdjAyVO8f2Py6NdZZNtgXpA= - -mptCZabDVbyWOOfkVcpYNqAyZNgbqzNBjySZVPb8zsyGRuxYSSR5jweMw8juIXxhD1jgjXLfb9zM -kwdJ14hDq+jd/Bm9Vu+KVD9h3fRfI97XO/4IBC1G77zzksw9XEAnqdi+Epfvg/75CVQw1O80vL4J -nkCAH1sd58ZOTOgMurc= + +ae2Sr9g/ctZPjw8D99wVnkhdk5WE6m6++Ipc9tNCS/RhsVBWI3NaVUyTkYLRu13C+npJ4gAiCbdH +ceRt0hA77bqxseTBbFbaczlad67xaVvJ0scnOlGN0y281Apy6RXGm7uhoKLYKpsrSjDXA5pBS+fx +flGvkHzaYNJj/DoxxrI= @@ -34,73 +34,5 @@ OWvN2cPLNeXHvV6ZIrC4rmK2ISpIXX4= -2012-10-13T14:26:16.189+01:00yScwzjo9znhFNIxY7fl2gnK1UhFTFcjXJE8aGBgfzfk=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US8Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)text/plainMIAGCSqGSIb3DQEHAqCAMIIPNgIBAzELMAkGBSsOAwIaBQAwgcUGCyqGSIb3DQEJEAEEoIG1BIGy -MIGvAgEBBgwrBgEEAb9VAwIBAQAwITAJBgUrDgMCGgUABBR5PllT1+QjBD1v1cBir6IhiePQNAIE -AN8GzhgPMjAxMjEwMTMxMzI2MTJaAQH/AgYBOlpNxkGgV6RVMFMxCzAJBgNVBAYTAkVTMR8wHQYD -VQQKExZHZW5lcmFsaXRhdCBWYWxlbmNpYW5hMQ8wDQYDVQQLEwZQS0lHVkExEjAQBgNVBAMTCVRT -QTEgQUNDVqCCC5wwggUJMIID8aADAgECAgRFYzz2MA0GCSqGSIb3DQEBBQUAMGgxCzAJBgNVBAYT -AkVTMR8wHQYDVQQKExZHZW5lcmFsaXRhdCBWYWxlbmNpYW5hMQ8wDQYDVQQLEwZQS0lHVkExJzAl -BgNVBAMTHlJvb3QgQ0EgR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTAeFw0wNjExMjExNzUyNTRaFw0x -NjExMTgxNjUyNTRaMFMxCzAJBgNVBAYTAkVTMR8wHQYDVQQKExZHZ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VyYWxpdGF0IFZhbGVuY2lhbmECBDtF5WgwDQYJKoZIhvcN -AQEBBQAEggEAaHwX+JJE5XcZnimxgn+cdvXfNu5xzkrvx63UBmGbfh509namPyQW11+E3OZDE7nd -vrVpRjheKLiVB19hiAnfnJlO3rEh0Q3GgERmdu9NdVmwJlhvAlwbpIgTLwKaIKdQARWlgmm6NLnV -MiAkOAUPDkgWhIRi1dO74YQJYiSNzytZarJnsTHx2dpNyOnaEVXlPaYP79bv3LNQyqLxlLjHEeza -6nG+z/z7w/jr4xWtoFmFC8YauytCDzHXtJWaBvd/aOn7UxwVxKyZTO3klYSU1S5PpJcBXiN9UqsQ -+SvVYK1siOhR7JzYkUipfCTP+iQomLHOZCKu0oCSp8xNV/e0SAAAAAA= +2017-02-06T15:20:00.174-02:00yScwzjo9znhFNIxY7fl2gnK1UhFTFcjXJE8aGBgfzfk=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US8Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)text/plainMIAGCSqGSIb3DQEHAqCAMIIVAgIBAzELMAkGBSsOAwIaBQAwggE3BgsqhkiG9w0BCRABBKCCASYEggEiMIIBHgIBAQYLKwYBBAG/VQNkAgAwITAJBgUrDgMCGgUABBR5PllT1+QjBD1v1cBir6IhiePQNAIELG/GwRgPMjAxNzAyMDYxNzIwMDBaAQH/AgYBWhRwfC+ggaqkgacwgaQxFzAVBgNVBAMMDlRTQTEgQUNDViAyMDE2MRAwDgYDVQQLDAdQS0lBQ0NWMUQwQgYDVQQKDDtBZ2VuY2lhIGRlIFRlY25vbG9nw61hIHkgQ2VydGlmaWNhY2nDs24gRWxlY3Ryw7NuaWNhIC0gQUNDVjERMA8GA1UEBwwIVmFsZW5jaWExETAPBgNVBAgMCFZhbGVuY2lhMQswCQYDVQQGEwJFU6EaMBgGCCsGAQUFBwEDBAwwCjAIBgYEAIGXXgGgghA7MIIIYDCCBkigAwIBAgIIDXSvZku1aQ0wDQYJKoZIhvc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U2Th87yCNt9Gu7gJqVcybIZ3ns1RZjqNDWuFcVkaY3gkxhoKb31R8+Lb3pPQZ2hLpptj+AxUDRWWgptttInrZT6px4VNIj/aJ5iK8HIaEfEFEYO+UdVKpys1LuUVJWHF/UEAzxoit6lYG4/d+MmLCddU22puRRZiKwQluP6NXa5/TvQlroPRirVJN2mb7DTwb8PJjHq8Qnjt6mYtuwJzVHnkFjpwprMC7tkd/iH3FysnE4yAoEoUMHRDSVo3SBjAAAAAA== \ No newline at end of file diff --git a/src/test/xml/document.signed.bes.xml b/src/test/xml/document.signed.bes.xml index 4bae4aeb..edcbd7f6 100644 --- a/src/test/xml/document.signed.bes.xml +++ b/src/test/xml/document.signed.bes.xml @@ -26,30 +26,30 @@ - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -5vTvWbBOaaerKvAMK4h+39VctkW8IeqzYuLN0zG6C0A= +eQsTZPMu37wOb2Vn8Y4gmuFyBAYMv82rFZr6CqrizyE= - + -Ug3BXKyY/mdTLT4zbURD73BzsA9c24ifL3zorq3hd+E= +D1Tt5iT34gJ0oia2ZY8yqhYjhivzVTQuZy19v43MXEc= - -atTIN4QnDKt+eUNNKJnuyTVUbNbkBzSVL5Csr7GxGb2Kea2v76WKVqmesC3AmN44GCA0ev07pf0Z -RN6zYDnZxdJQui0BuXXSheqomf/Q8UiaFOIV2zpHe0BX4EXyThPYNcctTWp2LieNXvmK9ARiBmI2 -km+nJ4ErTrzyEFn/bic= + +K4WZxDfB3tfz2SoViElhlZwl5oCNwo65/PuKd6FE+2NiQa3UJ/qqYdJcEGZdLM33EF/tq4UmPfmQ +n0KsoneJiC5RL+GqUJzpGg21PJlo6DgE1sTBekCU4/cG4vK2FOTfjPrex7n10EuXnkjeZsgM4R7d +jaHeQYJ3q6ftY/OCa9A= @@ -68,142 +68,6 @@ Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== -11223344556677889900 -2012-10-13T14:26:14.474+01:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869Isto é uma descrição do elemento raizhttp://elem.roothttp://doc1.txthttp://doc2.txttext/xmlMyEncodingIsto é uma descrição do elemento dentro do objecthttp://elem.in.objecthttp://doc3.txthttp://doc4.txttext/xmlMyEncodinghttp://uri.etsi.org/01903/v1.2.2#ProofOfApprovalIndicates that the signer has approved the content of the signed data objecthttp://uri.etsi.org/01903/v1.2.2#ProofOfCreationIndicates that the signer has created the signed data object (but not necessarily approved, nor sent it)#xmldsig-6c274201-1f33-4e98-b5a0-46ede5a15828-ref0#xmldsig-6c274201-1f33-4e98-b5a0-46ede5a15828-ref1MIAGCSqGSIb3DQEHAqCAMIIPNgIBAzELMAkGBSsOAwIaBQAwgcUGCyqGSIb3DQEJEAEEoIG1BIGy -MIGvAgEBBgwrBgEEAb9VAwIBAQAwITAJBgUrDgMCGgUABBSdlYBMGPockSlDGU6ZbJOHV+ok2gIE -AN8GzBgPMjAxMjEwMTMxMzI2MTBaAQH/AgYBOlpNuwugV6RVMFMxCzAJBgNVBAYTAkVTMR8wHQYD -VQQKExZHZW5lcmFsaXRhdCBWYWxlbmNpYW5hMQ8wDQYDVQQLEwZQS0lHVkExEjAQBgNVBAMTCVRT -QTEgQUNDVqCCC5wwggUJMIID8aADAgECAgRFYzz2MA0GCSqGSIb3DQEBBQUAMGgxCzAJBgNVBAYT -AkVTMR8wHQYDVQQKExZHZW5lcmFsaXRhdCBWYWxlbmNpYW5hMQ8wDQYDVQQLEwZQS0lHVkEx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VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZB -MScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmECBDtF5WgwDQYJKoZIhvcN -AQEBBQAEggEAoZwF9mcc6IcN77tOPSz2NMPuiq3Ny8zuufkg9EX27oU1wnvfkyIGtfHqlJqD5ZQx -rbGsKoAxMp2bYfbvVtftXQzCfYbLuuXTdt/BZky/5q1lanMcclDh2hMuv+zXAIbmMd1GrIHRK0k3 -LaWXZy3rkIgmDi5n4bwNRBkRYowD48a9RJYiRp7vx4I8ZJr8KFYfG+ECTNpaIX7WmKolAPcznUJo -rPi/gUOTS5vygqrCokmWv8nOjSiReVEOaQIxVoo1MAQWr2NvqHlEgZxggqNy97mtIWKYuOoEXp97 -Yx7385wrM53mD5jkZHtGT81Ql6Oc3KQhc8rc4K2PJLrbEpwTWwAAAAA= +11223344556677889900 +2017-02-06T15:20:02.098-02:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869Isto é uma descrição do elemento dentro do objecthttp://elem.in.objecthttp://doc3.txthttp://doc4.txttext/xmlMyEncodingIsto é uma descrição do elemento raizhttp://elem.roothttp://doc1.txthttp://doc2.txttext/xmlMyEncodinghttp://uri.etsi.org/01903/v1.2.2#ProofOfApprovalIndicates that the signer has approved the content of the signed data objecthttp://uri.etsi.org/01903/v1.2.2#ProofOfCreationIndicates that the signer has created the signed data object (but not necessarily approved, nor sent it)#xmldsig-77ee8e91-9d68-4dab-b6a1-af86e3557a77-ref1#xmldsig-77ee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XsMlCcM3NPoCzSQbVjfgVbpIwPFigUhH4OgynNM0RGI4+3b8BTZCeItUhBHN7UPvA2WrqLpLArWgDt17fxz4z5x6LTsLqOtjvpBe72Jps1vs9Vcx3dQwLLVMtnDP8g8tzOJWxjHpkNP7k5KhYvYXI4KDN118Dmo17+a3xLDOHSCHMMIiZU0ZR97uHz/YY7wKA8yV6ZvlTeK3CLpQS0dB+R/i8ZhanD+lGQxfDSC0CDDEdXymWfSB+x8eeH44aOXC/oo7DdPu4kL33dzDG1hn5skU2CEwE09ARktJJWh50z8/h9EYTUs9g0e8qbYgy1bCbup3l0Xgc81OdFMvBbwZnoCkNvi/pgR0bFPq24uqAUC/rS5t1aTltP7cYb6aMbcHFqGI889npl2a6lGw08TLBMk4RD/0jlcMp8ndGX9xjIBjOZVpdA9WeGw1gF++nESXueTCVr00Agai7yy6i49Q/M35goQk8IXSUSl1SggdGqy8AXRvMEwqgBwkQyV/m3adruE21gsAAAAAA== \ No newline at end of file diff --git a/src/test/xml/document.signed.c.xml b/src/test/xml/document.signed.c.xml index 6bd35bc8..bd26f1e0 100644 --- a/src/test/xml/document.signed.c.xml +++ b/src/test/xml/document.signed.c.xml @@ -26,26 +26,26 @@ - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -aUk8iTN0h7Snb2gsR/SVc6rDbNBWVbBEKUoX5jMyujU= +zwzK6BtmRlNofKKECv1Pu1ZeHY2N3lKYNY4IlQ/Fqrw= - -P06o2MQxP+6FNykD21GCPXnTVlJqxhRT3RUoo9oeEGY6iglq/A6b1lPANQyqVcD/od6nj1HaZ4pf -Kb/Pekgg5Z5pYcVICQ6Wd2jYC95WSCjnc7dA/l4uyZ+j/9jW2i2bzxNG3ORkj12j6RTnbkVH4Pz9 -9WFQqkHYHRkp1XV8Uww= + +ul1on82xj75EKz2DmGTae0D80R9FKH36MV8wKoIWOMOjXR1FqrEBusBO6e4GaBoLQrWfqB8cANNY +OnhO8Qt570RwqEiA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rXTLwmz69RMsa6P5J0CZH6yeF55bJQ80LQduis8E+5iasqkJeKSa -kFj8WXPKS7v0nLk3jDA5npAkvQO2QknkV9XkYcZGFUeFmk3sNisZSjOlYRXNowOEIQ5end2qeqR1 -l47EpaH8v54guy3ZmKbWjXerFiiO/IEBW+7mFhbavS3aGqPO+AAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1 +2017-02-06T15:23:21.057-02:00yScwzjo9znhFNIxY7fl2gnK1UhFTFcjXJE8aGBgfzfk=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US8MIAGCSqGSIb3DQEHAqCAMIIVAwIBAzELMAkGBSsOAwIaBQAwggE4BgsqhkiG9w0BCRABBKCCAScEggEjMIIBHwIBAQYLKwYBBAG/VQNkAgAwITAJBgUrDgMCGgUABBQ9arn4k2bPAt7yTYfMZhtPsDVkKgIFASocLBIYDzIwMTcwMjA2MTcyMzIzWgEB/wIGAVoUc4ueoIGqpIGnMIGkMRc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8pcw12FBc7chp+/uyWJMLQQfYyWeJ0glu5+mOMMH9jHIzaceopzbS9vYw5HFX59xfSIJAb0bGd8Ro0MtENaAii8bx/++Sn1YIFQBLF1radnwjBrwU8Hqy5YtYU9gq8hfTTnEgYy56YJOj7A/TUc4Yeo2mFjVhwTXRwFkCnhTZBDuKf5CD9FHSNZgRCMBAMauM1N8f34To8zPxJAtDOtS8HXn8khbHXmHUaJ9DRN4p8rOYzjVUi9AoupmfnyrDoirMNzX5XWT2jMvoDG2/uuht5mNFtGH5G/hNNZGSaJqzqmbO459fzpFPaTl2iXTi6jKrotewUq5P2Ghn3TgCV3/W3Vdbc4cMGv30yF/8psqv4VjQyooj/MNl4NbJSuQrV8dhWv4sGsAfK3epv9IU3CaCawGuNoMp4IvJwhB0Fps/MMQUS4NBD9sX7Xxjg3GBrlnQaSmXAq5qCqJfhsrgoSRiQhTlP6nusL+gmouJA1H3La2xBiFcIL7ouImKSCd1N2x9Zs3u+cIpxFH9GwEJgYuQJ5Y8pMvpN+0XUWNKrWDeaAGmJ7yhqAwzQ97HDxgJ4cIIakd24Yy8S4vwiigHLndpS2CEDf+TR66hgAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001 \ No newline at end of file diff --git a/src/test/xml/document.signed.epes.xml b/src/test/xml/document.signed.epes.xml index 9dd1aab4..f6ba8928 100644 --- a/src/test/xml/document.signed.epes.xml +++ b/src/test/xml/document.signed.epes.xml @@ -26,26 +26,26 @@ - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -huSWKAOeLTeeSJ+bdeSC8gn2K3iJeRvh2gDPRIX+y0A= +t4kyAbjOiEoiYF8TuAI9H+MuZpMfKhpRQqbICIgyE6E= - -XW+fNy1HhieqpFjmsli6DoyYCBvj+T1QvvzyoDcc9vKoEKV+gf8KYkCMF5Psl6Dd6Hy2ZWYOr7E+ -0bOZs01G6IO6nuDPSpomNrCB6dXxfYhSeG6PH7uE9eEgGabY/TJS1vcRvKro3ytP8/lqQANBUB0a -EEH9HWpGpkxEBGDkkyY= + +G/rANuc0vjLuNbf/jByuFy3BnknZ7QgNjwMmw0/jypd0K692W4aJtNjv8GiYH0YbWdoTM3A89ywG +e4MUpBz5wm4UaHZffhEM2hLIfRvi/j7doq1OZ3XlXJToMKhIxnX2sm5/nVrSsi9Caj9DPhgk8U/Q +R/7IxyzPBO5kqcKsyyM= @@ -64,5 +64,5 @@ Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== -2012-10-13T14:26:44.547+01:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869oid:/1.2.4.0.9.4.5MaW9PDxJruPHhjBVAMWyrF9zP+kMnNqkoQOUXxDDGAk= +2017-02-06T15:20:07.457-02:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869oid:/1.2.4.0.9.4.5MaW9PDxJruPHhjBVAMWyrF9zP+kMnNqkoQOUXxDDGAk= \ No newline at end of file diff --git a/src/test/xml/document.signed.t.bes.xml b/src/test/xml/document.signed.t.bes.xml index 4ed3195c..0cdb5279 100644 --- a/src/test/xml/document.signed.t.bes.xml +++ b/src/test/xml/document.signed.t.bes.xml @@ -26,26 +26,26 @@ - + - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -y80zF4vr94cXYQTBziVY4c9G1MpZgKsfqQz8/DGqHPw= ++Z5112S2otKB0Zjb8riqzsKNvJgvvPxZumqg0zxeV9U= - -lEZMVQ5lc9Vi+ABbPKVeGvBSKVLx7HUWM2NKncjmTGxU7o3eMyRRb1nIli0PRQrfsbpH4oDBbCO4 -Xndh/mUgFX/MiF38BiLWXogrIUZoqJGdwZbkeCJAce3tLleHP7Xn5Bcb7T7H5QrBNrPg2pkzij1d -VykpSt7kuscMgUxs6rw= + +Rs7LA5eRkWRIVzsxQSmbwJuvnh7Brj6yRH5nILPcDHX7jhoEbzVlv5cyuj4TQP2jQHk00ykWPktm +PejR0rqmFuxCBxH+l9FRTV1Yw+uqH0CTOV0s0GTRnysMOxvFXqW4leeYbNBUg9LuuuDyAdn1tBd9 +ddWJz1sQKibK01yMOVU= @@ -64,39 +64,5 @@ Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== -2012-10-13T14:26:51.833+01:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869MIAGCSqGSIb3DQEHAqCAMIIHigIBAzELMAkGBSsOAwIaBQAwZQYLKoZIhvcNAQkQAQSgVgRUMFIC -AQEGC2CGSAGG/W4BBxcEMCEwCQYFKw4DAhoFAAQUxJ38UAaHM35jVVdr+erUwP6HfVMCBEQWvU8Y -DzIwMTIxMDEzMTMyNjQ4WgIGATpaTk2toIIE5zCCBOMwggPLoAMCAQICAiAJMA0GCSqGSIb3DQEB -BQUAMGgxCzAJBgNVBAYTAlVTMSUwIwYDVQQKExxTdGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMu -MTIwMAYDVQQLEylTdGFyZmllbGQgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0x -MjA0MjYwNzAwMDBaFw0xNzA0MjYwNzAwMDBaMIG3MQswCQYDVQQGEwJVUzEQMA4GA1UECBMHQXJp -em9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEkMCIGA1UEChMbU3RhcmZpZWxkIFRlY2hub2xvZ2ll -cywgTExDMTMwMQYDVQQLEypodHRwOi8vY2VydHMuc3RhcmZpZWxkdGVjaC5jb20vcmVwb3NpdG9y -eS8xJjAkBgNVBAMTHVN0YXJmaWVsZCBUaW1lc3RhbX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4DAhoFAKCBjDAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTE3MDIwNjE3MjAwOFowIwYJKoZIhvcNAQkEMRYEFL+lsIkppOmxvSZhw7onG29fAiUzMCsGCyqGSIb3DQEJEAIMMRwwGjAYMBYEFFjn0XdhK9JeH7rCgHy1xy7kBMbTMA0GCSqGSIb3DQEBAQUABIIBAK8kgnUKCrgfs7+HA4YPyO3SGsq1IMPrn+EuKM3auyBl7hnIFC8HvNahIMC/GrtmDd+yhAPP/N4ydhzR3j3c6SRbRzb/GGY5e2IP7fQz3GTR+0UMMA4mpTTUuLQ4oa/NdnT7hHTNUmKBvOIZaIUmJlbh8VSqICAvilafuz+EvQkjNO4BKy7Bua3/lqZEN2LESaFETjtjT6MAYEBwPTIZfciy0ljrFHLAULM3i75bli6ap6ylzWOAiOdYhdpuLbdBLOD/dscm2w8p1a6y5maC7NfbWoPOhIspfBYBjy7bQD9pPW8H5PUmAz0e9ZeWR0GS/dvorvOmPb/OYRR/KOXIkXIAAAAA \ No newline at end of file diff --git a/src/test/xml/document.signed.t.epes.xml b/src/test/xml/document.signed.t.epes.xml index 70dc5175..674794ee 100644 --- a/src/test/xml/document.signed.t.epes.xml +++ b/src/test/xml/document.signed.t.epes.xml @@ -26,26 +26,26 @@ - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -G7VDVrEWyOvlfbYcjcZ5YBqhn6jKyt/RYqtE3cY0Uyw= +GWIdG4+oXW5/aD+bQkXidqfeH9kTx/lCjBgUFUDPK4w= - -O5iMeu9RYouE4bnFSV4p0MeXjqobL8UAwd+n8N/6o8MlR98J2ANVGeZPUQEC9UuWqHH+avufEplD -szOciMmYIAhmyo/sf2EdOcgPVGIxllB6q/pM/6EdzcklU3QWLwyhCkoprjw3/axLff2oI041qNWK -/RsOW6KLk6e08nRXNTU= + +O6oBy3lsR/pX5V8MvKjaYIVYXKwD1dlavvLU9xAL0jcgyPzchfh9EE5GBdKr/pz9F532l6HSlvZI +JQWQywHLUsrAWCwx1SPFiOjCN0+3WCKbxebymZxqqBSGpad8rCQxxk5XMSHixuO3YgzGJyCxmyX+ +Y8wWbAVcKjI+mcRqfjk= @@ -64,73 +64,5 @@ Ahu4PzJ6hggAlWWMy245JwIYuV0s1Oi39GVTxVNOBIX//AONZlGWO4S2Psb1mqdZ99b/MugsaA== -2012-10-13T14:26:53.502+01:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869MIAGCSqGSIb3DQEHAqCAMIIPNgIBAzELMAkGBSsOAwIaBQAwgcUGCyqGSIb3DQEJEAEEoIG1BIGy -MIGvAgEBBgwrBgEEAb9VAwIBAQAwITAJBgUrDgMCGgUABBTqQatyMPbqP5z2h4RjUKh8pxG9WQIE -ATiWkhgPMjAxMjEwMTMxMzI2NDlaAQH/AgYBOlpOU3SgV6RVMFMxCzAJBgNVBAYTAkVTMR8wHQYD -VQQKExZHZW5lcmFsaXRhdCBWYWxlbmNpYW5hMQ8wDQYDVQQLEwZQS0lHVkExEjAQBgNVBAMTCVRT -QTEgQUNDVqCCC5wwggUJMIID8aADAgECAgRFYzz2MA0GCSqGSIb3DQEBBQUAMGgxCzAJBgNVBAYT -AkVTMR8wHQYDVQQKExZHZW5lcmFsaXRhdCBWYWxlbmNpYW5hMQ8wDQYDVQQLEwZQS0lHVkExJzAl -BgNVBAMTHlJvb3QgQ0EgR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTAeFw0wNjExMjExNzUyNTRaFw0x -NjExMTgxNjU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1UECxMGUEtJR1ZB -MScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmECBDtF5WgwDQYJKoZIhvcN -AQEBBQAEggEAHKQq1ZmXsBkY6LANx375Ow9ftfKdncTTXUziLxtBg+3yGQkAHqkDIXi9mfUVsWdk -1PkjftRQ6lInqzUWSGvpfOcJfQEFYagUkugMwEXWq6Pwqgr6w7E5ufzEVWFXna9KtLbKkTQStRLa -FUlzJXXZurccAB41DcUH20FY6YNBg5ZKDIBcazdTQHlUI3HHXcpgVUz5pHCJi3om88rbgEURws8D -NlkWGtgPELsJc43hPti8UTO4Yeud9QfZVgIrKpg2T7/oJ3fHCT4WbPlkwkkUXbJSAnAmNxzBjM1i -ycU4HRXI/z6riYTeRMlRYnI9AaKC3KMnSKZEZy4FXxM8/zR+vwAAAAA= +2017-02-06T15:20:07.530-02:004btVb5gQ5cdcNhGpvDSWQZabPQrR9jf1x8e3YF9Ajss=CN=Itermediate,OU=CC,O=ISEL,C=PT-119284162484605703133798696662099777223vm5QpbblsWV7fCYXotPhNTeCt4nk8cLFuF36L5RJ4Ok=CN=TestCA,OU=CC,O=ISEL,C=PT-46248926895392336918291885380930606289AUaN+IdhKQqxIVmEOrFwq+Dn22ebTkXJqD3BoOP/x8E=CN=TestCA,OU=CC,O=ISEL,C=PT-99704378678639105802976522062798066869MIAGCSqGSIb3DQEHAqCAMIIVAgIBAzELMAkGBSsOAwIaBQAwggE3BgsqhkiG9w0BCRABBKCCASYEggEiMIIBHgIBAQYLKwYBBAG/VQNkAgAwITAJBgUrDgMCGgUABBTlowfZ/4mtRaKzv8mU3RWT+AFtvQIELG/G0RgPMjAxNzAyMDYxNzIwMDdaAQH/AgYBWhRwl3OggaqkgacwgaQxFzAVBgNVBAMMDlRTQTEgQUNDViAyMDE2MRAwDgYDVQQLDAdQS0lBQ0NWMUQwQgYDVQQKDDtBZ2VuY2lhIGRlIFRlY25vbG9nw61hIHkgQ2VydGlmaWNhY2nDs24g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HXCO4q/jVvrbnAHtyiVa9bpEFxIitGQqJEv9R6TD9lpX2VvFDLygKjT8MtLv2thyQZJhcAPI3vab1nUxaCRYfK0BjOldnfC3iyxMqULEG9pPU1t3ssWEbxLfwGibtLp2MqT+4JlLrSL5Nht8C2BsAw72F5yuYDR9VrgX3Tk4ShK85VfpwyZ4oECVQlGY+o+wjlMtTNGUeW0CJ5JISf+jLLuhDjnKMWDfKY2up2w4rLnEVtZZ4BlEgc/gODqBApGWkC7RsL3bmZmisQFgpvIKdVnOE0i1LzE3g5VxKBDHF6/lWyRTLw/qK5GeCUPxjgJ3hVw0r1PXEzezliSEadTOFBetXx7i5G4rc7dTXt43YfK77OlCYCsJKk7F+g4q8nRipYiC217W902lIiUcmqBB+N82WxBQ+MpxJ2avdFL9mjROR5IrlV3GhkFNNOsHAAAAAA== \ No newline at end of file diff --git a/src/test/xml/document.verified.c.x.xml b/src/test/xml/document.verified.c.x.xml index 181294db..89e4b36f 100644 --- a/src/test/xml/document.verified.c.x.xml +++ b/src/test/xml/document.verified.c.x.xml @@ -26,26 +26,26 @@ - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -aUk8iTN0h7Snb2gsR/SVc6rDbNBWVbBEKUoX5jMyujU= +zwzK6BtmRlNofKKECv1Pu1ZeHY2N3lKYNY4IlQ/Fqrw= - -P06o2MQxP+6FNykD21GCPXnTVlJqxhRT3RUoo9oeEGY6iglq/A6b1lPANQyqVcD/od6nj1HaZ4pf -Kb/Pekgg5Z5pYcVICQ6Wd2jYC95WSCjnc7dA/l4uyZ+j/9jW2i2bzxNG3ORkj12j6RTnbkVH4Pz9 -9WFQqkHYHRkp1XV8Uww= + +ul1on82xj75EKz2DmGTae0D80R9FKH36MV8wKoIWOMOjXR1FqrEBusBO6e4GaBoLQrWfqB8cANNY +OnhO8Qt570RwqEiA0pzF8tCY0aoJJ/bA+KDSgfyvy/5XNZvtrz8bU8BrpdIDha2SIWuS9vYfyxDZ +2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3jDA5npAkvQO2QknkV9XkYcZGFUeFmk3sNisZSjOlYRXNowOEIQ5end2qeqR1 -l47EpaH8v54guy3ZmKbWjXerFiiO/IEBW+7mFhbavS3aGqPO+AAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1MIAGCSqGSIb3DQEHAqCAMIIVAgIBAzELMAkGBSsOAwIaBQAwggE3BgsqhkiG9w0BCRABBKCCASYE -ggEiMIIBHgIBAQYLKwYBBAG/VQNkAgAwITAJBgUrDgMCGgUABBRCG+JPtKN6FA2EoOFh/o2rbJ64 -ggIEKppmJxgPMjAxNjA3MTQxODAwMDNaAQH/AgYBVeqQwHKggaqkgacwgaQxFzAVBgNVBAMMDlRT -QTEgQUNDViAyMDE2MRAwDgYDVQQLDAdQS0lBQ0NWMUQwQgYDVQQKDDtBZ2VuY2lhIGRlIFRlY25v -bG9nw61hIHkgQ2VydGlmaWNhY2nDs24gRWxlY3Ryw7NuaWNhIC0gQUNDVjERMA8GA1UEBwwIVmF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HXn8khbHXmHUaJ9DRN4p8rOYzjVUi9AoupmfnyrDoirMNzX5XWT2jMvoDG2/uuht5mNFtGH5G/hNNZGSaJqzqmbO459fzpFPaTl2iXTi6jKrotewUq5P2Ghn3TgCV3/W3Vdbc4cMGv30yF/8psqv4VjQyooj/MNl4NbJSuQrV8dhWv4sGsAfK3epv9IU3CaCawGuNoMp4IvJwhB0Fps/MMQUS4NBD9sX7Xxjg3GBrlnQaSmXAq5qCqJfhsrgoSRiQhTlP6nusL+gmouJA1H3La2xBiFcIL7ouImKSCd1N2x9Zs3u+cIpxFH9GwEJgYuQJ5Y8pMvpN+0XUWNKrWDeaAGmJ7yhqAwzQ97HDxgJ4cIIakd24Yy8S4vwiigHLndpS2CEDf+TR66hgAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001MIAGCSqGSIb3DQEHAqCAMIIVAwIBAzELMAkGBSsOAwIaBQAwggE4BgsqhkiG9w0BCRABBKCCAScEggEjMIIBHwIBAQYLK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BAYTAkVTAghew7emQ3+k4DANBgkqhkiG9w0BAQEFAASCAgCMVJVZEgdyNMmVURgAHJQ5e6DghKTQy+kChLtrtUXMveaPMfkHQiOXjJL7y8yGrBsjHHu4A+wDxm48DbLjRu2mfEDE2AxeIyy0dzc6cDOE1oE8sgPcq/atQNJ35uP1Uwfrg01ti4TJtNWJZUtLvz2yK+IIpp7WEVQ+84EHsYbN2CnX9zPLfuR7GQl4V99y/eG1R0xntclGJ1tU3r+lrzox7DU1x4v/6Dxt99c8aLfa2ZpUVbJB1E/5USILmPYoY0jnSsgopgmz6K+TspKUNDBYXio1E6PMIn4IWBFBCTGHh7YG975NcHjeN3xO1HWlwCvmgGMzABJV9uhTZPrgsExbldMWo+YraQnMseMxhcIb4JXgdqeR13dvOTbZVgXPwXvuLqiEBeezG+9ntCz6B7qNfdm/5+rftUeXoR3hnybpLQcGIkagdqQf5lrQOyxvggGHyUfxc84DczXVowg72FpVvKEWjDW/x3jiUilom+tMv5YiRT8FWf8A/Gq+6RZuQUssGflCY4j2LgAr1vYkL4mGwlmmQEHQBN89dkt+ZQJ/aMZkXHz9GQoHhlndbw5Cn4PUW0lW3q/mxV4Eci+AInj/Q+Ulisiz692DfBonBgGAyv/DOJU/e1oCHG5Sf96IfVAogKQDJQY2TaQBMKgEU8szpjU+NFdR7iR49TDnPxCATwAAAAA= \ No newline at end of file diff --git a/src/test/xml/document.verified.c.xl.a.xml b/src/test/xml/document.verified.c.xl.a.xml index 536b814b..d330d14f 100644 --- a/src/test/xml/document.verified.c.xl.a.xml +++ b/src/test/xml/document.verified.c.xl.a.xml @@ -26,26 +26,26 @@ - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -aUk8iTN0h7Snb2gsR/SVc6rDbNBWVbBEKUoX5jMyujU= +zwzK6BtmRlNofKKECv1Pu1ZeHY2N3lKYNY4IlQ/Fqrw= - -P06o2MQxP+6FNykD21GCPXnTVlJqxhRT3RUoo9oeEGY6iglq/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dGF0IFZhbGVuY2lhbmECBDtF5WgwDQYJKoZIhvcN -AQEBBQAEggEAYIF08VpzyEDLrvOcbTuby+z91SnMANLBW4Xf3XSEoJC5snPTyWeQeKTJpmp2A16+ -Ns1fcLqVm0Z4eCjx7VZ+t5nNsy7NdRo2G0S8EUTaYWE9S2Z+fWWhpQhEKtmpAbCsJoIk36rQIMo7 -dsST8VmMv+lghiTU+bthB1FSrXTLwmz69RMsa6P5J0CZH6yeF55bJQ80LQduis8E+5iasqkJeKSa -kFj8WXPKS7v0nLk3jDA5npAkvQO2QknkV9XkYcZGFUeFmk3sNisZSjOlYRXNowOEIQ5end2qeqR1 -l47EpaH8v54guy3ZmKbWjXerFiiO/IEBW+7mFhbavS3aGqPO+AAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1MIAGCSqGSIb3DQEHAqCAMIIPNgIBAzELMAkGBSsOAwIaBQAwgcUGCyqGSIb3DQEJEAEEoIG1BIGy -MIGvAgEBBgwrBgEEAb9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l4NbJSuQrV8dhWv4sGsAfK3epv9IU3CaCawGuNoMp4IvJwhB0Fps/MMQUS4NBD9sX7Xxjg3GBrlnQaSmXAq5qCqJfhsrgoSRiQhTlP6nusL+gmouJA1H3La2xBiFcIL7ouImKSCd1N2x9Zs3u+cIpxFH9GwEJgYuQJ5Y8pMvpN+0XUWNKrWDeaAGmJ7yhqAwzQ97HDxgJ4cIIakd24Yy8S4vwiigHLndpS2CEDf+TR66hgAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001v4dIw4odnHNqHyAoHbc1l3C17kCF/F3Z2ii9v8n2TYA=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001MIAGCSqGSIb3DQEHAqCAMIIVAwIBAzELMAkGBSsOAwIaBQAwggE4BgsqhkiG9w0BCRABBKCCAScEggEjMIIBHwIBAQYLKwYBBAG/VQNkAgAwITAJBgUrDgMCGgUABBSFCiyaODXwYEweZ5ovPjgPt+k5HgIFASocLLUYDzIwMTcwMjA2MTcyNTI5WgEB/wIGAVoUdYTcoIGqpIGnMIGkMRcwFQYDVQQDDA5UU0ExIEFDQ1YgMjAxNjEQ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JKoZIhvcNAQkEMRYEFFGd9CztxalHOD+zT5aTHvHbONOkMIGaBgsqhkiG9w0BCRACDDGBijCBhzCBhDAWBBRHfmx70VTNZHUzg+GMHZMc8akN+DBqBBSTBXqIFcZPzogv+pEWUih4vFNkFzBSMEakRDBCMRIwEAYDVQQDDAlBQ0NWUkFJWjExEDAOBgNVBAsMB1BLSUFDQ1YxDTALBgNVBAoMBEFDQ1YxCzAJBgNVBAYTAkVTAghew7emQ3+k4DANBgkqhkiG9w0BAQEFAASCAgAs7SzTTmHLXuIvIQsUZ7zQV4nB0sa6jDnPjX8ixnBW10QYUlIyiWqyv7MAE06iaQw1jWei9zazNCb7KmnfwNpQyeersXDv/KkM/K9wxcKAvf+9CR+MdXTfDP7bbWMRavgUEOcBZ1Az4jAeQECOoPjh6dgInp04c1gs4YthcZzj3e2iSmj8w8m5c3Zouw9ztTXGolynaXxspcUnQijoWF8FozDhzz4LvrN1sFpp+ekFNWhZvvgkM8SyUXBPfRnYb8zXeqaXM5YkQC1+GO9RdJdbTC0q0/TzUZ+WW1Z3lH5goNu2rsz+bGhVDKMRWYHIrXXXsldGc8RcNY2bKUQWOE0VbyTtFVoF5/NQNjnLfkRRwPrp/wvEgkVIMLHkNAmm8yhd14pk5+AGD1+q5gQogsINisjLLss6UGhmeF8mjkBjDG1gL4m73rGY/aiuiqZQXqXx4BEtVhyySQ5oy84hUB2EGWSHcTzTu1kM9YEwIav/kf4OuvbINmxfCzMkz79znczWOmtQSuVxTSDV6fgEDyUmoPwKzE30TkuThUogTk2Zir9JHXk77gAHu4UXm/LMZarXKpqOjcOUeFCCL9ljwZ6ZyLVBqDtsC7/y5uSDvEup07OltvT0OWRqJdyUBHpZsTU7Ubq0kOXQOGzh0X2EF8xJagV8po6ZtjBCE8rDqK9vNwAAAAA= \ No newline at end of file diff --git a/src/test/xml/document.verified.c.xl.xml b/src/test/xml/document.verified.c.xl.xml index f4fb7fb3..6066bc97 100644 --- a/src/test/xml/document.verified.c.xl.xml +++ b/src/test/xml/document.verified.c.xl.xml @@ -1,4 +1,4 @@ - + Questions, unanswered Steve and the flubberblubs @@ -26,26 +26,26 @@ - + - + rD/g8soqKz8EiPUBhEWfcQacS0ta4ULHX3dKMEH6ZoQ= - + -aUk8iTN0h7Snb2gsR/SVc6rDbNBWVbBEKUoX5jMyujU= +zwzK6BtmRlNofKKECv1Pu1ZeHY2N3lKYNY4IlQ/Fqrw= - -P06o2MQxP+6FNykD21GCPXnTVlJqxhRT3RUoo9oeEGY6iglq/A6b1lPANQyqVcD/od6nj1HaZ4pf -Kb/Pekgg5Z5pYcVICQ6Wd2jYC95WSCjnc7dA/l4uyZ+j/9jW2i2bzxNG3ORkj12j6RTnbkVH4Pz9 -9WFQqkHYHRkp1XV8Uww= + +ul1on82xj75EKz2DmGTae0D80R9FKH36MV8wKoIWOMOjXR1FqrEBusBO6e4GaBoLQrWfqB8cANNY +OnhO8Qt570RwqEiA0pzF8tCY0aoJJ/bA+KDSgfyvy/5XNZvtrz8bU8BrpdIDha2SIWuS9vYfyxDZ +2kCy5dTYFQOps08uLac= @@ -65,200 +65,5 @@ OWvN2cPLNeXHvV6ZIrC4rmK2ISpIXX4= -2012-10-13T14:26:32.006+01:00yScwzjo9znhFNIxY7fl2gnK1UhFTFcjXJE8aGBgfzfk=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US8MIAGCSqGSIb3DQEHAqCAMIIPNgIBAzELMAkGBSsOAwIaBQAwgcUGCyqGSIb3DQEJEAEEoIG1BIGy -MIGvAgEBBgwrBgEEAb9VAwIBAQAwITAJBgUrDgMCGgUABBSpE6FPADpE041XbFBOEZP3tqrdJQIE -AN8GzxgPMjAxMjEwMTMxMzI2MjhaAQH/AgYBOlpOAKygV6RVMFMxCzAJBgNVBAYTAkVTMR8wHQYD -VQQKExZHZW5lcmFsaXRhdCBWYWxlbmNpYW5hMQ8wDQYDVQQLEwZQS0lHVkExEjAQBgNVBAMTCVRT -QTEgQUNDVqCCC5wwggU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qhkiG9w0B -CQQxFgQUWM7qRsKRkNVKkFVQyExAB7keGRQwgb0GCyqGSIb3DQEJEAIMMYGtMIGqMIGnMBYEFBoc -doV/v0QImB514nMBThkR9apzMIGMBBSgc+XFvUNhDYZMIRMKhVhXzJzqRjB0MGykajBoMQswCQYD -VQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZB -MScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmECBDtF5WgwDQYJKoZIhvcN -AQEBBQAEggEAYIF08VpzyEDLrvOcbTuby+z91SnMANLBW4Xf3XSEoJC5snPTyWeQeKTJpmp2A16+ -Ns1fcLqVm0Z4eCjx7VZ+t5nNsy7NdRo2G0S8EUTaYWE9S2Z+fWWhpQhEKtmpAbCsJoIk36rQIMo7 -dsST8VmMv+lghiTU+bthB1FSrXTLwmz69RMsa6P5J0CZH6yeF55bJQ80LQduis8E+5iasqkJeKSa -kFj8WXPKS7v0nLk3jDA5npAkvQO2QknkV9XkYcZGFUeFmk3sNisZSjOlYRXNowOEIQ5end2qeqR1 -l47EpaH8v54guy3ZmKbWjXerFiiO/IEBW+7mFhbavS3aGqPO+AAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US1999-01-01T12:01:00.000Z1BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqM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PDPXSTz+Tju8TAdLFbK2pd0Dmf2XlYFelG03p9SQSe8pcw12FBc7chp+/uyWJMLQQfYyWeJ0glu5+mOMMH9jHIzaceopzbS9vYw5HFX59xfSIJAb0bGd8Ro0MtENaAii8bx/++Sn1YIFQBLF1radnwjBrwU8Hqy5YtYU9gq8hfTTnEgYy56YJOj7A/TUc4Yeo2mFjVhwTXRwFkCnhTZBDuKf5CD9FHSNZgRCMBAMauM1N8f34To8zPxJAtDOtS8HXn8khbHXmHUaJ9DRN4p8rOYzjVUi9AoupmfnyrDoirMNzX5XWT2jMvoDG2/uuht5mNFtGH5G/hNNZGSaJqzqmbO459fzpFPaTl2iXTi6jKrotewUq5P2Ghn3TgCV3/W3Vdbc4cMGv30yF/8psqv4VjQyooj/MNl4NbJSuQrV8dhWv4sGsAfK3epv9IU3CaCawGuNoMp4IvJwhB0Fps/MMQUS4NBD9sX7Xxjg3GBrlnQaSmXAq5qCqJfhsrgoSRiQhTlP6nusL+gmouJA1H3La2xBiFcIL7ouImKSCd1N2x9Zs3u+cIpxFH9GwEJgYuQJ5Y8pMvpN+0XUWNKrWDeaAGmJ7yhqAwzQ97HDxgJ4cIIakd24Yy8S4vwiigHLndpS2CEDf+TR66hgAAAAA=6F5s4TtqSCTt+/C6kxSWxGiyQ/2uBQ/tQ2IFjNjna3U=CN=CA1-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US7YvyeUickj8O9yN2JXM991ULBr5v7aQnC0Dl5yNm6HnM=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US63FPfkaoV1oQ0qvdahhmupFWYoIMIw0Aekh0eJz5BpH0=CN=Trust Anchor,OU=Testing,OU=DoD,O=U.S. Government,C=US99999BxdjnMvJhUPD983q3SAF8rwz+xj9kig5cqMbuQlF3Y4=CN=CA2-CP.02.01,OU=Testing,OU=Dod,O=U.S. Government,C=US1999-01-01T10:01:00.000-02:001i1mVIJL63tU9nnIhbS1uxiOHYSrEtMsehOKLK2hDD8U=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NWoC4/ImTPaict53Q+5ORsRWsKEmnCMf/q/oze45jT6iyW7Sv15CzyVm+MxLCIr7POkYgaZgO7Kq/JV/f/86vmnLiHTeWAJ67ePUY2mgOs1BfuaFFYujFmVDnDf9kiI7OLYM0LSb/BugUP+0Kj2xnoHPETk3vXMI+KtPXkWZrj18D/rBVV2iwNUuw1aaaCessxOPtlIPHi+uLHn0NMPkDYUDjnIb1RVsJSo5mThRgXKjqWVdNreFpozOBOl3addcFjlrXxIYdaKjR1tAo/oCrPkJde3fnPmxMSZMynPeX8FzsHwib5rxf6A2/ZSn2i9fOVmGuW5Cd1DdmMso5i1jHH4a9lehRz7N6CufJL0F1NNZ1KvHbUzW19ZROHj0OVQCS6C0kqR4yNrk+gof0C1mKKOzSCsTEeUXOGFEDKlwk/74RcKh5T+FZ49O4WP490iWrqNGFj+dsGwYrYD1G+9nDIHWxmZv5LvUgwmrAftouYU2Utzu9bs+dUB7UQZ338KHMCFS48sVDqe8fMJFbitVXpZQC3Ga8YwX7lAe0yKcKD7v3YaqGN7hdVFPfS7DlfX \ No newline at end of file From 232bb6afeba064b2594bede7e2265b14f9b89d3d Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Mon, 6 Feb 2017 15:33:17 -0200 Subject: [PATCH 82/84] Changes DefaultTimeStampTokenProvider to non final to permit add monitoring off tsa service --- .../xades4j/providers/impl/DefaultTimeStampTokenProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/xades4j/providers/impl/DefaultTimeStampTokenProvider.java b/src/main/java/xades4j/providers/impl/DefaultTimeStampTokenProvider.java index 462149fa..1a43045d 100644 --- a/src/main/java/xades4j/providers/impl/DefaultTimeStampTokenProvider.java +++ b/src/main/java/xades4j/providers/impl/DefaultTimeStampTokenProvider.java @@ -86,7 +86,7 @@ public DefaultTimeStampTokenProvider(MessageDigestEngineProvider messageDigestPr } @Override - public final TimeStampTokenRes getTimeStampToken( + public TimeStampTokenRes getTimeStampToken( byte[] tsDigestInput, String digestAlgUri) throws TimeStampTokenGenerationException { From 6cc733278c3c6dca08c3f413571270b9c367c151 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Tue, 11 Apr 2017 08:59:55 -0300 Subject: [PATCH 83/84] DefaultTimeStampTokenProvider.getHttpConnection is now protected. --- .../providers/impl/AuthenticatedTimeStampTokenProvider.java | 3 +-- .../xades4j/providers/impl/DefaultTimeStampTokenProvider.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/xades4j/providers/impl/AuthenticatedTimeStampTokenProvider.java b/src/main/java/xades4j/providers/impl/AuthenticatedTimeStampTokenProvider.java index 1d19dac6..9d4af237 100644 --- a/src/main/java/xades4j/providers/impl/AuthenticatedTimeStampTokenProvider.java +++ b/src/main/java/xades4j/providers/impl/AuthenticatedTimeStampTokenProvider.java @@ -44,8 +44,7 @@ public AuthenticatedTimeStampTokenProvider( } @Override - HttpURLConnection getHttpConnection() throws IOException - { + protected HttpURLConnection getHttpConnection() throws IOException { HttpURLConnection connection = super.getHttpConnection(); connection.setRequestProperty("Authorization", "Basic " + this.base64tsaUsrAndPwd); return connection; diff --git a/src/main/java/xades4j/providers/impl/DefaultTimeStampTokenProvider.java b/src/main/java/xades4j/providers/impl/DefaultTimeStampTokenProvider.java index 1a43045d..ed9d0abd 100644 --- a/src/main/java/xades4j/providers/impl/DefaultTimeStampTokenProvider.java +++ b/src/main/java/xades4j/providers/impl/DefaultTimeStampTokenProvider.java @@ -153,8 +153,7 @@ private InputStream getResponse(byte[] encodedRequest) throws TimeStampTokenGene } } - HttpURLConnection getHttpConnection() throws IOException - { + protected HttpURLConnection getHttpConnection() throws IOException { URL url = new URL(getTSAUrl()); return (HttpURLConnection) url.openConnection(); } From 56c36bd2977669ed7f8d983150fd6dd2888ad171 Mon Sep 17 00:00:00 2001 From: Tiago Rossi Date: Tue, 6 Feb 2018 08:26:42 -0200 Subject: [PATCH 84/84] Remove BoucyCastleProvider from test --- src/test/java/xades4j/verification/CertPathBuilderTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/xades4j/verification/CertPathBuilderTest.java b/src/test/java/xades4j/verification/CertPathBuilderTest.java index c7c55d5a..fcdf366f 100644 --- a/src/test/java/xades4j/verification/CertPathBuilderTest.java +++ b/src/test/java/xades4j/verification/CertPathBuilderTest.java @@ -126,7 +126,7 @@ public void test1() throws Exception { System.out.println("test1"); - CertPathBuilder builder = CertPathBuilder.getInstance("PKIX", "BC"); + CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"/*, "BC"*/); X509CertSelector userCertSelector = new X509CertSelector(); userCertSelector.setCertificate(userCert.getCertificate());