You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Ling Xiaohan <li...@cn.fujitsu.com> on 2008/09/23 02:29:24 UTC

Help:Reference of local system file using JDK failed!

Hi,

    I used XML-dsig classes in JDK6.0 for XML signature, but encountered an 
abjective
problem. It seems that signature could not contain reference pointed to 
relative local
path when using XML-dsig classes in JDK6.0. For instance,
                        XMLSignatureFactory.newReference("test.txt",...)
which want to make a reference to "test.txt" in the current directory. 
Unfortunately, the
call threw exception about dereference.

    I know there is a class named ResolverLocalFilesystem in XML-dsig 
implementation of
apache can solve above case. But in JDK6.0 is this a function limitation for 
XML signature?
Or exist other method for relative local path reference?
    Anyone replied is appreciated.
    Thanks a lot.

Nolen 

Re: Help:Reference of local system file using JDK failed!

Posted by Ling Xiaohan <li...@cn.fujitsu.com>.
Thanks Sean, it works when BaseURI is set.

----- Original Message ----- 
> You need to set the base URI before you generate or validate the 
> XMLSignature.
> Use the DOMSignContext.setBaseURI or DOMValidateContext.setBaseURI 
> methods.
>
> --Sean
>
> Ling Xiaohan wrote:
>> Hi,
>>
>>     I used XML-dsig classes in JDK6.0 for XML signature, but encountered
>> an abjective
>> problem. It seems that signature could not contain reference pointed to
>> relative local
>> path when using XML-dsig classes in JDK6.0. For instance,
>>                         XMLSignatureFactory.newReference("test.txt",...)
>> which want to make a reference to "test.txt" in the current directory.
>> Unfortunately, the
>> call threw exception about dereference.
>>
>>     I know there is a class named ResolverLocalFilesystem in XML-dsig
>> implementation of
>> apache can solve above case. But in JDK6.0 is this a function limitation
>> for XML signature?
>> Or exist other method for relative local path reference?
>>     Anyone replied is appreciated.
>>     Thanks a lot.
>>
>> Nolen
>
>
> 



Re: Help:Reference of local system file using JDK failed!

Posted by Sean Mullan <Se...@Sun.COM>.
You need to set the base URI before you generate or validate the XMLSignature.
Use the DOMSignContext.setBaseURI or DOMValidateContext.setBaseURI methods.

--Sean

Ling Xiaohan wrote:
> Hi,
>  
>     I used XML-dsig classes in JDK6.0 for XML signature, but encountered 
> an abjective
> problem. It seems that signature could not contain reference pointed to 
> relative local
> path when using XML-dsig classes in JDK6.0. For instance,
>                         XMLSignatureFactory.newReference("test.txt",...)
> which want to make a reference to "test.txt" in the current directory. 
> Unfortunately, the
> call threw exception about dereference.
>  
>     I know there is a class named ResolverLocalFilesystem in XML-dsig 
> implementation of
> apache can solve above case. But in JDK6.0 is this a function limitation 
> for XML signature?
> Or exist other method for relative local path reference?
>     Anyone replied is appreciated.
>     Thanks a lot.
>  
> Nolen