You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Michael Kail <mi...@rl-ag.com> on 2006/03/21 12:05:48 UTC

Remove KeyValue from xml signature

Hi to all!

I'v got a problem:
I'm creating an enveloped xml signature. That works. But in the signed
document is Field KeyValue that contains DSAKeyValue. And I just wan't
to know if there is any Way to tell xmlsignature not to write that
information into document(as we don't need it).
Here's my current code:

		javax.xml.parsers.DocumentBuilder db =
dbf.newDocumentBuilder();
	     	org.w3c.dom.Document doc = db.parse(signatureFile);
	      String BaseURI = signatureFile.toURL().toString();

	
ElementProxy.setDefaultPrefix("http://www.w3.org/2000/09/xmldsig#",null)
;
	      
	      XMLSignature sig = new XMLSignature(doc, BaseURI,
	
XMLSignature.ALGO_ID_SIGNATURE_DSA);
	      
	      //add siognature infomaetion to document
	      Node nl = doc.getFirstChild();
	      nl.appendChild(sig.getElement());
	      
	      Transforms transforms = new Transforms(doc);

	
transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE);
	           
	      //add document "archivdescriptor" to signed content
	      sig.addDocument("", transforms,
Constants.ALGO_ID_DIGEST_SHA1);

Hope there's anybody who got a hint!

Thanks for help, michael