NAME
XML::LibXMLSec::Simple - simpler way to use xmlsec
SYNOPSIS
use XML::LibXML;
use XML::LibXMLSec::Simple;
my $document = XML::LibXML->load_xml(...);
if (XML::LibXMLSec::Simple::verify(
$document,
$pem_certificate_string,
)) {
...
}
DESCRIPTION
This is the module you probably want to use for most simple usage cases of XML::LibXMLSec
.
This module does not export any function, you should use the fully qualified name to call them.
FUNCTIONS
verify
if (XML::LibXMLSec::Simple::verify(
$document,
$pem_certificate_string,
)) {
...
}
This function takes a XML::LibXML::Document
object, and a string contaninig a PEM-encoded X509 certificate. It returns a true value if the document contains a valid signature produced with the private key corresponding to the certificate.
It uses XML::LibXMLSec::Utils::find_node
to find the signature node inside the document, XML::LibXMLSec::KeysManager
to handle the certificate, and XML::LibXMLSec::DSigContext
to verify the signature.