0 Replies Latest reply: May 14, 2013 12:23 PM by 824461 RSS

    How can I change namespace from ds to dsig dynamically

    824461
      Hi

      How can I change namespace from ds to dsig dynamically, I have done something like this

      ElementProxy.setDefaultPrefix(Constants.SignatureSpecNS, prefix); //prefix is a variable which will be the value of the namespace like ds, dsig, junk

      the value of this prefix is passed by user, but it always uses the first value passed by the user
      for eg. suppose user first passes dsid then that particular document is signed using dsig prefix but later when user passes ds as a prefix even then also it take dsig as a prefix it does not change it to ds.

      here is how it shows.
      <dsig:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
      <dsig:SignedInfo>
      <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></dsig:CanonicalizationMethod>
      <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></dsig:SignatureMethod>
      <dsig:Reference URI="#Document">
      <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod>
      <dsig:DigestValue>FoDCzLgru6a0EI9YVLV5g1QHcMk=</dsig:DigestValue>
      </dsig:Reference>
      </dsig:SignedInfo>
      <dsig:SignatureValue>
      iDCVV/8TbC2p1aXxFs8+JUMqstfCkdAz7kRFd8/cVsfyM2W0ZxmxLXezvSTmf9SR7gPwMAHO8m4o
      YrDXGacG2DalskdfajdslkfjaVgOK2LKj4eqWcU0QzRNnOdTTGMRL+f0qvZmmhJa+q2
      swHzphDdwKYuOIxCNNU=
      </dsig:SignatureValue>
      <dsig:Object Id="Document">some document</dsig:Object>
      </dsig:Signature>
      Thanks
      Abhishek