List Info

Thread: SHA1 hash of canonicalized xml




SHA1 hash of canonicalized xml
country flaguser name
United States
2007-08-02 12:20:38
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 ?

thanks !


Missed the show?  Watch videos of the Live Earth Concert on MSN. See them now!
Re: SHA1 hash of canonicalized xml
country flaguser name
United States
2007-08-02 14:31:43
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

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )