digital Signature failure

185 views
Skip to first unread message

jo...@gravityconsultancy.in

unread,
Apr 15, 2015, 4:51:15 AM4/15/15
to xmlse...@googlegroups.com
If i use the following code, the signature get added and successfully validate by server


$objDSig = new XMLSecurityDSig();
$objDSig->setCanonicalMethod(XMLSecurityDSig::C14N);
$node = $objDSig->addObject($dom->documentElement);
//print_r($node);exit;
$objDSig->addReference($node, XMLSecurityDSig::SHA1, array('http://www.w3.org/2000/09/xmldsig#enveloped-signature'), array('force_uri' => TRUE));


if i use the following

$objDSig = new XMLSecurityDSig();
    $objDSig->setCanonicalMethod(XMLSecurityDSig::C14N);

    $objDSig->addReference($dom, XMLSecurityDSig::SHA1, array('http://www.w3.org/2000/09/xmldsig#enveloped-signature'),array('force_uri' => TRUE));

its not get validated.


What's the issue here. Actually I need Reference URI="".

Please reply .

Rob Richards

unread,
May 8, 2015, 3:21:37 PM5/8/15
to xmlse...@googlegroups.com, jo...@gravityconsultancy.in
Unsure wether you really need the addObject or not, but if you have nodes (like comments) between the prolog and the document element, signatures are calculated differently. Also the type of canonicalization used affects this as well. Too little information on what the end server was expecting and what your input document looked like to say one way or another.

Rob
Reply all
Reply to author
Forward
0 new messages