Hi, You can use the following method in DSIGSignature class : XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *createBlankSignature( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, canonicalizationMethod cm = CANON_C14N_NOC, signatureMethod sm = SIGNATURE_DSA, hashMethod hm = HASH_SHA1 );
Since you only need a SHA1 HASH, pass the signatureMethod as SIGNATURE_NONE. Br, Raghu. thanks Sean for your reply, i'm using the c++ lib and was looking for the solution in the xml-securty-c. So is there a way to do this using the c++ libs thanks!! > Date: Thu, 2 Aug 2007 15:31:43 -0400 > From: [EMAIL PROTECTED] > Subject: Re: SHA1 hash of canonicalized xml > To: security-dev@xml.apache.org > > k b wrote: > > How do i generate SHA1 hash of canonicalized xml ? > > i just want the sha1 hash. > > > > I know while signing a doc one can get the hash, > > but in this case i just want the hash and don't want to go through the > > signing process. is there an easier way ? > > > > Yes, but you will have to use one of the following APIs: > > 1. javax.xml.crypto.dsig.TransformService if you are using the JSR 105 API > > 2. org.apache.xml.security.c14n.Canonicalizer > > > Use one of these APIs to canonicalize the node-set, and then use a > java.security.MessageDigest or java.security.DigestOutputStream to > digest the resulting bytes. > > --Sean The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com