robrichards / xmlseclibs

A PHP library for XML Security
BSD 3-Clause "New" or "Revised" License
386 stars 180 forks source link

Signature Validation Failed using Java #259

Open kumarakmuz opened 6 months ago

kumarakmuz commented 6 months ago

??

Mats commented 2 months ago

This might be due to the element missing the URI attribute. You can try the following and see if that fixes your problem:

// Sign using SHA-256 
$objDSig->addReference( 
    $doc,  
    XMLSecurityDSig::SHA256,  
    ['http://www.w3.org/2000/09/xmldsig#enveloped-signature'],
    ['force_uri' => true] // <----- this causes $force_uri to be true, which in turn results in the attribute URI="" being added
);