Search in sources :

Example 6 with UnsignedProperties

use of xades4j.properties.UnsignedProperties in project xades4j by luisgoncalves.

the class XadesSignatureFormatExtenderImplTest method testEnrichSignatureWithT.

@Test
public void testEnrichSignatureWithT() throws Exception {
    System.out.println("enrichSignatureWithT");
    Document doc = getDocument("document.signed.bes.xml");
    Element signatureNode = (Element) doc.getElementsByTagNameNS(Constants.SignatureSpecNS, "Signature").item(0);
    XadesSignatureFormatExtenderImpl instance = (XadesSignatureFormatExtenderImpl) new XadesFormatExtenderProfile().getFormatExtender();
    XMLSignature sig = new XMLSignature(signatureNode, "");
    Collection<UnsignedSignatureProperty> usp = new ArrayList<UnsignedSignatureProperty>(1);
    usp.add(new SignatureTimeStampProperty());
    instance.enrichSignature(sig, new UnsignedProperties(usp));
    outputDocument(doc, "document.signed.bes.enriched.t.xml");
}
Also used : SignatureTimeStampProperty(xades4j.properties.SignatureTimeStampProperty) XMLSignature(org.apache.xml.security.signature.XMLSignature) Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) UnsignedSignatureProperty(xades4j.properties.UnsignedSignatureProperty) Document(org.w3c.dom.Document) UnsignedProperties(xades4j.properties.UnsignedProperties) Test(org.junit.Test)

Aggregations

UnsignedProperties (xades4j.properties.UnsignedProperties)6 UnsignedSignatureProperty (xades4j.properties.UnsignedSignatureProperty)6 ArrayList (java.util.ArrayList)5 XMLSignature (org.apache.xml.security.signature.XMLSignature)3 Test (org.junit.Test)3 Document (org.w3c.dom.Document)3 Element (org.w3c.dom.Element)3 QualifyingProperties (xades4j.properties.QualifyingProperties)2 SignedDataObjectProperty (xades4j.properties.SignedDataObjectProperty)2 SignedProperties (xades4j.properties.SignedProperties)2 SignedSignatureProperty (xades4j.properties.SignedSignatureProperty)2 UnsignedDataObjectProperty (xades4j.properties.UnsignedDataObjectProperty)2 HashSet (java.util.HashSet)1 NodeList (org.w3c.dom.NodeList)1 ArchiveTimeStampProperty (xades4j.properties.ArchiveTimeStampProperty)1 CounterSignatureProperty (xades4j.properties.CounterSignatureProperty)1 DataObjectDesc (xades4j.properties.DataObjectDesc)1 QualifyingProperty (xades4j.properties.QualifyingProperty)1 SignatureTimeStampProperty (xades4j.properties.SignatureTimeStampProperty)1