You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Radu Preotiuc-Pietro <ra...@bea.com> on 2006/01/03 01:19:28 UTC

RE: XmlBeans and xml digitail signature

Are you using XmlBeans V2? Both of those features work as per the DOM
spec as far as I know, this is the code I used to test this:

    XmlObject o = XmlObject.Factory.parse(new File("test.xml"));
    Document d = (Document) o.getDomNode();
    org.w3c.dom.Element e = d.getDocumentElement();
    System.out.println("Tag name: " + e.getTagName());
    NamedNodeMap atts = e.getAttributes();
    for (int i = 0; i < atts.getLength(); i++)
        System.out.println("name=" + atts.item(i).getNodeName() + ",
value=" + atts.item(i).getNodeValue());

Are you sure that these two things are what's causing issues? If you're
positive, then it would help if you could submit the particular use-case
that's giving you trouble, because in the general case, it seems to work
ok.

Thanks,
Radu

-----Original Message-----
From: Giedrius Trumpickas [mailto:trumpyla@gmail.com] 
Sent: Thursday, December 29, 2005 11:31 AM
To: user@xmlbeans.apache.org
Subject: XmlBeans and xml digitail signature


Hi,

I have tried to use apache xml-security 1.3.0 framework to  create xml
digital signatures for xmlbean instances with no success.
Apache xml security framework uses DOM node as input for signature
creation but unfortunately xml beans DOM api does not work as expected.
I have compiled SAML 2.0 core schemas and trying to create SAML 2.0
assertion and digitally sign it.

I have noticed following problems:

1) There is no way how to get xmlns:* attribute value through xml beans
DOM API and apache xml security excpects it
3) Element#getTagName does not return fully qualified name namespace
prefix is missing

It would be nice to specify namespaceURI mapping to prefix when creating
new XML bean instances or specify at compile time when compiling
schemas, then Element#getTagName can return normal fully qualified name.

Without these features XML canonicalization of xml bean instances does
not work when trying to canonicalize by using apache xml security.
Is there is any plans to support xml security in XML beans? Or at least
XML digital signature.

Thanks,

Giedrius

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: XmlBeans and xml digitail signature

Posted by Giedrius Trumpickas <tr...@gmail.com>.
Radu,

In your case it works because you are loading existing XML file with
namespace prefixes and namespace declaration attributes.

Problem happens when you are creating a new XML bean instance and then
trying to access DOM nodes.
There is no way how to specify namespaceURI to prefix mapping when creating
instance of XML bean. Namespace declarations are missing as well.

When serializing to xml xmlText you can pass XmlOptions with prefixes but
when creating you can't do it. I will send you a test case shortly.

Giedrius


On 1/2/06, Radu Preotiuc-Pietro <ra...@bea.com> wrote:
>
> Are you using XmlBeans V2? Both of those features work as per the DOM
> spec as far as I know, this is the code I used to test this:
>
>     XmlObject o = XmlObject.Factory.parse(new File("test.xml"));
>     Document d = (Document) o.getDomNode();
>     org.w3c.dom.Element e = d.getDocumentElement();
>     System.out.println("Tag name: " + e.getTagName());
>     NamedNodeMap atts = e.getAttributes();
>     for (int i = 0; i < atts.getLength(); i++)
>         System.out.println("name=" + atts.item(i).getNodeName() + ",
> value=" + atts.item(i).getNodeValue());
>
> Are you sure that these two things are what's causing issues? If you're
> positive, then it would help if you could submit the particular use-case
> that's giving you trouble, because in the general case, it seems to work
> ok.
>
> Thanks,
> Radu
>
> -----Original Message-----
> From: Giedrius Trumpickas [mailto:trumpyla@gmail.com]
> Sent: Thursday, December 29, 2005 11:31 AM
> To: user@xmlbeans.apache.org
> Subject: XmlBeans and xml digitail signature
>
>
> Hi,
>
> I have tried to use apache xml-security 1.3.0 framework to  create xml
> digital signatures for xmlbean instances with no success.
> Apache xml security framework uses DOM node as input for signature
> creation but unfortunately xml beans DOM api does not work as expected.
> I have compiled SAML 2.0 core schemas and trying to create SAML 2.0
> assertion and digitally sign it.
>
> I have noticed following problems:
>
> 1) There is no way how to get xmlns:* attribute value through xml beans
> DOM API and apache xml security excpects it
> 3) Element#getTagName does not return fully qualified name namespace
> prefix is missing
>
> It would be nice to specify namespaceURI mapping to prefix when creating
> new XML bean instances or specify at compile time when compiling
> schemas, then Element#getTagName can return normal fully qualified name.
>
> Without these features XML canonicalization of xml bean instances does
> not work when trying to canonicalize by using apache xml security.
> Is there is any plans to support xml security in XML beans? Or at least
> XML digital signature.
>
> Thanks,
>
> Giedrius
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>