robrichards/xmlseclibs

I have to digitally sign an XML document with the xmlseclibs library in Codeigniter4

Closed this issue · 2 comments

I use the basic example from Github, we install it via composer as advised. The first error I have when you want to use the library files

use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecurityKey;

that doesn't work anymore, I use an absolute access

require "../xmlseclibs/vendor/robrichards/xmlseclibs/src/XMLSecurityDSig.php";
require "../xmlseclibs/vendor/robrichards/xmlseclibs/src/XMLSecurityKey.php";

the error disappears but it does not recognize the instance

$doc = new DOMDocument(); <--ERROR HERE Class 'App\Controllers\DOMDocument' not found

I don't know if I am accessing the files wrong or there is another error.

Thank you very much.

Add use DOMDocument; to your file.

This is basic PHP knowledge and has nothing to do with this library.

Thanks for your help! the problem was solved