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