Hello,
 
I have the following xml document, valid according to a schema.
 
<first  xmlns="http://com.first">
    <second>val</second>
    <enclosing>
  <dsig:Signature xmlns="http://www.w3.org/2000/09/xmldsig#" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="sigenclosing">
   <dsig:SignedInfo Id="sigenclosing-SignedInfo">
    <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
    <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
    <dsig:Reference URI="">
     <dsig:Transforms>
      <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
     </dsig:Transforms>
     <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
     <dsig:DigestValue>sPaR/y8BhcZ7azjwjEESiZuFUj0=</dsig:DigestValue>
    </dsig:Reference>
    <dsig:Reference URI="#sigenclosing-SignedProperties">
     <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
     <dsig:DigestValue>Jo4nDU4/+sPCX+nXruVpoQp8rS8=</dsig:DigestValue>
    </dsig:Reference>
   </dsig:SignedInfo>
   <dsig:SignatureValue Id="sigenclosing Value">pRj0rxmxkI8leH1WQEQhIIAYbtcIcmo8M=</dsig:SignatureValue>
   <dsig:KeyInfo Id="sigenclosing-KeyInfo">
    <dsig:KeyValue>
     <dsig:RSAKeyValue>
      <dsig:Modulus>qeIGBJkYU9Xyn0aS6uU8mVygVrccOR1kiNHlHqPvC6guHM2oB64u9vx/8Px4dzcA0R4uY1wU=</dsig:Modulus>
      <dsig:Exponent>AQAB</dsig:Exponent>
     </dsig:RSAKeyValue>
    </dsig:KeyValue>
    <dsig:X509Data>
     <dsig:X509Certificate>p56MOIKa+8whxLjSqe1lvgQLxpDJx1aKfJ8qcB1d+mEdWae6R3HZpigtzFFCqiok</dsig:X509Certificate>
    </dsig:X509Data>
   </dsig:KeyInfo>
   <dsig:Object>
    <xad:QualifyingProperties xmlns="http://uri.etsi.org/01903/v1.2.2#" xmlns:xad="http://uri.etsi.org/01903/v1.2.2#" Target="#sigenclosing">
     <xad:SignedProperties Id="sigenclosing-SignedProperties">
      <xad:SignedSignatureProperties>
       <xad:SigningCertificate>
        <xad:Cert>
         <xad:CertDigest>
          <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
          <dsig:DigestValue>6Rv0GElerfoe0gH5FBo50b3Otrw=</dsig:DigestValue>
         </xad:CertDigest>
         <xad:IssuerSerial>
          <dsig:X509IssuerName>ou=REAL,ou=AC déléguée,ou=Notaires,o=Professions Réglementées,c=fr</dsig:X509IssuerName>
          <dsig:X509SerialNumber>716550</dsig:X509SerialNumber>
         </xad:IssuerSerial>
        </xad:Cert>
       </xad:SigningCertificate>
      </xad:SignedSignatureProperties>
      <xad:SignedDataObjectProperties/>
     </xad:SignedProperties>
     <xad:UnsignedProperties>
      <xad:UnsignedSignatureProperties>
       <xad:SignatureTimeStamp Id="sigenclosing-TimeStamp">
        <xad:Include URI="#sigenclosing-Value"/>
        <xad:EncapsulatedTimeStamp>N1vWamMOXstksig=</xad:EncapsulatedTimeStamp>
       </xad:SignatureTimeStamp>
      </xad:UnsignedSignatureProperties>
     </xad:UnsignedProperties>
    </xad:QualifyingProperties>
   </dsig:Object>
  </dsig:Signature>
  </enclosing>
</first>
 
When I do the XmlObject.Factory.parse, after the execution of this method XmlBean transforms my xml document (while debugging).  See below.
 
I realize that when parsing the Signature node, even though that the default namespace is defined and a dsig prefix at the Signature level, XmlBeans can not find it.  Inside the Signature node, there is the QualifyingProperties node.  It is defined with it's default namespace and prefix.
The QualifyingProperties node uses elements of the prefix dsig, referenced by the namespace "http://www.w3.org/2000/09/xmldsig#".
When parsing, the prefixe dsig it's not detected at the signature level, however, it is added at the element root with an another prefix name identify by xd
And the nodes dsig referenced inside QualifyingProperties have changed by the prefix xd.
 
I don't understand the way XmlBean does the parsing.  Why my xml document has changed? 
 
I need the original signature node as it was submitted to the parse method.  Could someone tell me please, how XmlBeans analyzes the xml document?
 
    <second>val</second>
    <enclosing>
  <dsig:Signature xmlns="http://www.w3.org/2000/09/xmldsig#" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="sigenclosing">
   <dsig:SignedInfo Id="sigenclosing-SignedInfo">
    <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
    <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
    <dsig:Reference URI="">
     <dsig:Transforms>
      <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
     </dsig:Transforms>
     <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
     <dsig:DigestValue>sPaR/y8BhcZ7azjwjEESiZuFUj0=</dsig:DigestValue>
    </dsig:Reference>
    <dsig:Reference URI="#sigenclosing-SignedProperties">
     <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
     <dsig:DigestValue>Jo4nDU4/+sPCX+nXruVpoQp8rS8=</dsig:DigestValue>
    </dsig:Reference>
   </dsig:SignedInfo>
   <dsig:SignatureValue Id="sigenclosing Value">pRj0rxmxkI8leH1WQEQhIIAYbtcIcmo8M=</dsig:SignatureValue>
   <dsig:KeyInfo Id="sigenclosing-KeyInfo">
    <dsig:KeyValue>
     <dsig:RSAKeyValue>
      <dsig:Modulus>qeIGBJkYU9Xyn0aS6uU8mVygVrccOR1kiNHlHqPvC6guHM2oB64u9vx/8Px4dzcA0R4uY1wU=</dsig:Modulus>
      <dsig:Exponent>AQAB</dsig:Exponent>
     </dsig:RSAKeyValue>
    </dsig:KeyValue>
    <dsig:X509Data>
     <dsig:X509Certificate>p56MOIKa+8whxLjSqe1lvgQLxpDJx1aKfJ8qcB1d+mEdWae6R3HZpigtzFFCqiok</dsig:X509Certificate>
    </dsig:X509Data>
   </dsig:KeyInfo>
   <dsig:Object>
    <xad:QualifyingProperties xmlns="http://uri.etsi.org/01903/v1.2.2#" xmlns:xad="http://uri.etsi.org/01903/v1.2.2#" Target="#sigenclosing">
     <xad:SignedProperties Id="sigenclosing-SignedProperties">
      <xad:SignedSignatureProperties>
       <xad:SigningCertificate>
        <xad:Cert>
         <xad:CertDigest>
          <xd:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
          <xd:DigestValue>6Rv0GElerfoe0gH5FBo50b3Otrw=</xd:DigestValue>
         </xad:CertDigest>
         <xad:IssuerSerial>
          <xd:X509IssuerName>ou=REAL,ou=AC déléguée,ou=Notaires,o=Professions Réglementées,c=fr</xd:X509IssuerName>
          <xd:X509SerialNumber>716550</xd:X509SerialNumber>
         </xad:IssuerSerial>
        </xad:Cert>
       </xad:SigningCertificate>
      </xad:SignedSignatureProperties>
      <xad:SignedDataObjectProperties/>
     </xad:SignedProperties>
     <xad:UnsignedProperties>
      <xad:UnsignedSignatureProperties>
       <xad:SignatureTimeStamp Id="sigenclosing-TimeStamp">
        <xad:Include URI="#sigenclosing-Value"/>
        <xad:EncapsulatedTimeStamp>N1vWamMOXstksig=</xad:EncapsulatedTimeStamp>
       </xad:SignatureTimeStamp>
      </xad:UnsignedSignatureProperties>
     </xad:UnsignedProperties>
    </xad:QualifyingProperties>
   </dsig:Object>
  </dsig:Signature>
  </enclosing>
</first>


Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.

Reply via email to