NAME
XML::LibXMLSec::Utils - utility functions and constants
DESCRIPTION
This module provides some useful functions and constants for use with xmlsec
. Nothing is exported, you should use the fully qualified name of the functions to call them.
FUNCTIONS
add_id_attr
XML::LibXMLSec::Utils::add_id_attr(
$xml_doc,
$node_namespace_uri,
$node_name,
$attr_name,
);
This function scans the XML document, looking for nodes with the given namespace and local name. If any such node exists, and has an attribute of the given name, that attribute is marked as an "ID".
This is useful, for example, when you have a signed XML document, but no DTD, and the signature contains things like <ds:Reference URI="#id84193712402627052114698066">
. That reference won't work unless the corresponding attribute has been marked as an ID. In those cases you'd do:
XML::LibXMLSec::Utils::add_id_attr(
$document,
'urn:oasis:names:tc:SAML:2.0:protocol','Response',
'ID',
);
(This example works for SAML assertions).
find_node
my $xml_node = XML::LibXMLSec::Utils::find_node(
$xml_doc,
$node_namespace_uri,
$node_name,
);
Scans the given document, and returns the first node (in document order) with the given namespace and local name.
CONSTANTS
XML Namespaces
NS
The string http://www.aleksey.com/xmlsec/2002
DSIG_NS
The string http://www.w3.org/2000/09/xmldsig#
ENC_NS
The string http://www.w3.org/2001/04/xmlenc#
XKMS_NS
The string http://www.w3.org/2002/03/xkms#
XPATH_NS
The string http://www.w3.org/TR/1999/REC-xpath-19991116
XPATH2_NS
The string http://www.w3.org/2002/06/xmldsig-filter2
XPOINTER_NS
The string http://www.w3.org/2001/04/xmldsig-more/xptr
SOAP11_NS
The string http://schemas.xmlsoap.org/soap/envelope/
SOAP12_NS
The string http://www.w3.org/2002/06/soap-envelope
XML Digital Signature node names
NODE_SIGNATURE
The string Signature
NODE_SIGNED_INFO
The string SignedInfo
NODE_CANONICALIZATION_METHOD
The string CanonicalizationMethod
NODE_SIGNATURE_METHOD
The string SignatureMethod
NODE_SIGNATURE_VALUE
The string SignatureValue
NODE_DIGEST_METHOD
The string DigestMethod
NODE_DIGEST_VALUE
The string DigestValue
NODE_OBJECT
The string Object
NODE_MANIFEST
The string Manifest
NODE_SIGNATURE_PROPERTIES
The string SignatureProperties
XML Encryption node names
NODE_ENCRYPTED_DATA
The string EncryptedData
NODE_ENCRYPTION_METHOD
The string EncryptionMethod
NODE_ENCRYPTION_PROPERTIES
The string EncryptionProperties
NODE_ENCRYPTION_PROPERTY
The string EncryptionProperty
NODE_CIPHER_DATA
The string CipherData
NODE_CIPHER_VALUE
The string CipherValue
NODE_CIPHER_REFERENCE
The string CipherReference
NODE_REFERENCE_LIST
The string ReferenceList
NODE_DATA_REFERENCE
The string DataReference
NODE_KEY_REFERENCE
The string KeyReference
NODE_CARRIED_KEY_NAME
The string CarriedKeyName
SEE ALSO
https://www.aleksey.com/xmlsec/api/xmlsec-transforms.html the original documentation.