From 7916c117627db0411b35f202f88b2ab6e115361a Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> Date: Fri, 28 Jan 2005 14:10:50 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'MOA-ID-1_20d09'. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/MOA-ID-1_20d09@264 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../SignatureManifestCheckParams.java | 176 --------------------- 1 file changed, 176 deletions(-) delete mode 100644 spss.test/src/testgenerator/SignatureManifestCheckParams.java (limited to 'spss.test/src/testgenerator/SignatureManifestCheckParams.java') diff --git a/spss.test/src/testgenerator/SignatureManifestCheckParams.java b/spss.test/src/testgenerator/SignatureManifestCheckParams.java deleted file mode 100644 index b1505418d..000000000 --- a/spss.test/src/testgenerator/SignatureManifestCheckParams.java +++ /dev/null @@ -1,176 +0,0 @@ -package testgenerator; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.apache.xml.serialize.DOMWriterImpl; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - - -/** - * @author knirschs - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class SignatureManifestCheckParams { -/* So solls mal aussehen :-) - - - - - - - - - - - validBase64Data - - - validID - - -*/ - private Document document; - private Element refInfo; - private Element verifyTrans; - private Element transPara; - private Element dsigTrans; - - public SignatureManifestCheckParams(String returnReferenceInputData) throws Exception{ - - // Find the implementation - DocumentBuilderFactory factory - = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - DocumentBuilder builder = factory.newDocumentBuilder(); - DOMImplementation impl = builder.getDOMImplementation(); - - // Create the document - document = impl.createDocument(null, "SignatureManifestCheckParams", null); - - //document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); // Create from whole cloth - Element root = document.getDocumentElement(); - if (returnReferenceInputData!=null) - root.setAttribute("ReturnReferenceInputData",returnReferenceInputData); - - refInfo = (Element) document.createElement("ReferenceInfo"); - root.appendChild(refInfo); - - verifyTrans = (Element) document.createElement("VerifyTransformsInfoProfile"); - - - } - - public void addTransPara(String URI) - { - transPara = document.createElement("TransformParameter"); - transPara.setAttribute("URI",URI); - verifyTrans.appendChild(transPara); - - } - - - /** - * Method addDsigTransform: To add an dsig:Tranform element with a special algorithm - * @param algName - */ - public void addDsigTransform(String algName, Element el) - { - if (dsigTrans==null) - { - dsigTrans = (Element) document.createElementNS("http://www.w3.org/2000/09/xmldsig#","Transforms"); - dsigTrans.setPrefix("dsig"); - verifyTrans.appendChild(dsigTrans); - - refInfo.appendChild(verifyTrans); - } - - - Element trans = document.createElementNS("http://www.w3.org/2000/09/xmldsig#","Transform"); - trans.setPrefix("dsig"); - trans.setAttribute("Algorithm",algName); - if (el!=null) trans.appendChild(el); - dsigTrans.appendChild(trans); - } - - public void addDisgTransform(Element transformElement) - { - if (dsigTrans==null) - { - dsigTrans = (Element) document.createElementNS("http://www.w3.org/2000/09/xmldsig#","Transforms"); - dsigTrans.setPrefix("dsig"); - verifyTrans.appendChild(dsigTrans); - - refInfo.appendChild(verifyTrans); - } - - dsigTrans.appendChild(transformElement); - } - - /** - * Method addTransformsProfileID. - * @param id - */ - public void addTransformsProfileID(String id) - { - Element profID = (Element) document.createElement("VerifyTransformsInfoProfileID"); - profID.appendChild(document.createTextNode(id)); - refInfo.appendChild(profID); - } - - public void addTransParaElement(String elemName, String content) - { - if (elemName!="Hash") { - - Element eleName = document.createElement(elemName); - eleName.appendChild(document.createTextNode(content)); - transPara.appendChild(eleName); - - } else { - - Element eleName = document.createElement(elemName); - Element digMethod = document.createElementNS("http://www.w3.org/2000/09/xmldsig#","DigestMethod"); - digMethod.setPrefix("dsig"); - digMethod.setAttribute("Algorithm","http://www.w3.org/2000/09/xmldsig#sha1"); - eleName.appendChild(digMethod); - Element hash = document.createElementNS("http://www.w3.org/2000/09/xmldsig#","DigestValue"); - hash.setPrefix("dsig"); - hash.appendChild(document.createTextNode(content)); - eleName.appendChild(hash); - - transPara.appendChild(eleName); - - - } - - } - -public String returnDoc() throws Exception - { - String result =(new DOMWriterImpl(true)).writeToString(document.getDocumentElement()); - - TestCases tc = new TestCases(); - - result = TestCases.replaceString(result,"",""); - try { - result = TestCases.replaceString(result," xmlns:dsig=\"http://www.w3.org/2000/09/xmldsig#\"",""); - result = TestCases.replaceString(result," xmlns:dsig=\"http://www.w3.org/2000/09/xmldsig#\"",""); - result = TestCases.replaceString(result," xmlns:dsig=\"http://www.w3.org/2000/09/xmldsig#\"",""); - } catch (Exception e) { - } - - - return result; - } - - public Document getDoc() throws Exception - { - return document; - } -} -- cgit v1.2.3