XML::LibXMLSec::DSigContext - XML digital signature context
This class wraps the xmldsig portion of xmlsec.
xmldsig
xmlsec
new
my $dsig = XML::LibXMLSec::DSigContext->new(); my $dsig = XML::LibXMLSec::DSigContext->new($key_manager);
Builds a new context, optionally tying it to a XML::LibXMLSec::KeysManager.
XML::LibXMLSec::KeysManager
enabled_reference_uris
$dsig->enabled_reference_uris( XML::LibXMLSec::Transform::URI_TYPE_SAME_DOCUMENT() | XML::LibXMLSec::Transform::URI_TYPE_LOCAL() );
Sets the enabledReferenceUris field. This is a bit field, its value should be obtained by or-ing together the URI_TYPE_* constants from XML::LibXMLSec::Transform.
enabledReferenceUris
or
URI_TYPE_*
XML::LibXMLSec::Transform
verify
my $status = $dsig->verify($xml_node);
Given a signature node (you can use XML::LibXMLSec::Utils::find_node to get it from an arbitrary XML document), returns a status code (see the "signature status" constants).
XML::LibXMLSec::Utils::find_node
This function does not return a boolean!
These constants are returned by "verify".
STATUS_UNKNOWN
Something went wrong, we don't know if the signature is valid or not.
STATUS_SUCCEEDED
The signature is valid.
STATUS_INVALID
The signature is not valid.
https://www.aleksey.com/xmlsec/api/xmlsec-xmldsig.html the original documentation.
To install XML::LibXMLSec, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::LibXMLSec
CPAN shell
perl -MCPAN -e shell install XML::LibXMLSec
For more information on module installation, please visit the detailed CPAN module installation guide.