NAME

XML::LibXMLSec::DSigContext - XML digital signature context

DESCRIPTION

This class wraps the xmldsig portion of xmlsec.

METHODS

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.

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.

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).

This function does not return a boolean!

CONSTANTS

Signature status

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.

SEE ALSO

https://www.aleksey.com/xmlsec/api/xmlsec-xmldsig.html the original documentation.