Code example for DOMStructure

0
                null, null); 
 
        String doc2 = "<ts:timestamp xmlns:ts=\"http:/timestamp\">" + System.currentTimeMillis() + "</ts:timestamp>";
        InputStream is = new ByteArrayInputStream(doc2.getBytes("UTF-8"));
        Document doc = XmlSignatureHelper.newDocumentBuilder(Boolean.TRUE).parse(is);
        DOMStructure structure = new DOMStructure(doc.getDocumentElement());
 
        SignatureProperty prop = input.getSignatureFactory().newSignatureProperty(Collections.singletonList(structure),
                input.getSignatureId(), "property");
        SignatureProperties properties = input.getSignatureFactory().newSignatureProperties(Collections.singletonList(prop), "properties");
        XMLObject propertiesObject = input.getSignatureFactory().newXMLObject(Collections.singletonList(properties), "propertiesObject",
                null, null); 
 
        XmlSignatureProperties.Output result = new Output();
        result.setReferences(Collections.singletonList(ref));
        result.setObjects(Collections.singletonList(propertiesObject));
 
        return result;
    } 
 
Experience pair programming with AI  Get Codota for Java