Net::SA...erifyXML(3)

πŸ“¦ version 0.85, in alpine 3.24

πŸ¦‹ Net::SAML2::Role::VerifyXML β€” a role to verify the SAML response XML πŸ’…

okay so bestie, this is Net::SAML2::Role::VerifyXML, straight out of the User Contributed Perl Documentation section of your man pages. It's a Moose role πŸ’– β€” you slap it on a class and boom, that class can verify SAML response XML. Iconic. Let's get into it.


✨ VERSION ✨

version 0.85 β€” that's the one, no cap πŸŽ€


🌸 SYNOPSIS 🌸

so here's the whole vibe of how you'd use it:

use Net::SAML2::Some::Module;

use Moose;
with 'Net::SAML2::Role::VerifyXML';

sub do_something_with_xml {
    my $self = shift;
    my $xml  = shift;

    $self->verify_xml($xml,
        # Most of these options are passed to Net::SAML2::XML::Sig, except for the
        # cacert
        # Most options are optional
        cacert    => $self->cacert,
        cert_text => $self->cert,
        no_xml_declaration => 1,
    );
}

like, you with the role, and then verify_xml just exists on your object now. main character energy fr fr πŸ‘‘ and yes, most of those options get passed straight through to Net::SAML2::XML::Sig β€” the one exception is cacert. also note: most options are optional πŸ’…


🧚 DESCRIPTION 🧚

bestie. there's literally nothing here. the DESCRIPTION section is empty in the actual page β€” no prose, not a single word 😭 so I'm not gonna sit here and make stuff up. the good stuff is all in METHODS. moving on 🫢


🌈 METHODS 🌈

⭐ verify_xml($xml, %args)

this is the whole point of the role, honestly. here's the full spread of what it takes:

$self->verify_xml($xml,
    # Most of these options are passed to Net::SAML2::XML::Sig, except for the
    # cacert
    # Most options are optional
    cert_text => $self->cert,
    no_xml_declaration => 1,

    # Used for a trust model, if lacking, everything is trusted
    cacert  => $self->cacert,
    # or check specific certificates based on subject/issuer or issuer hash
    anchors => {
        # one of the following is allowed
        subject     => ["subject a",     "subject b"],
        issuer      => ["Issuer A",      "Issuer B"],
        issuer_hash => ["Issuer A hash", "Issuer B hash"],
    },
);

a little tour of the args, since you asked:

  • $xml β€” the XML you're verifying. the whole reason you're here πŸŽ€
  • %args β€” the rest of the options. most options are optional, and most of them get forwarded to Net::SAML2::XML::Sig β€” except cacert, which is special.
  • cert_text β€” the cert text, passed through.
  • no_xml_declaration β€” here it's set to 1. yes bestie, 1 is a value, we stay precise πŸ’…
  • cacert β€” used for a trust model. and heads up: if it's lacking, everything is trusted 😭πŸ”₯ take that in for a sec, that's literally the documented behaviour.
  • anchors β€” the alternative to cacert: check specific certificates instead. it's a hashref, and one of the following is allowed inside it:
    • subject β€” a list like ["subject a", "subject b"]
    • issuer β€” a list like ["Issuer A", "Issuer B"]
    • issuer_hash β€” a list like ["Issuer A hash", "Issuer B hash"]
⚠️ re-read that cacert line, okay? lacking a cacert means everything is trusted. that's the documented behaviour, not me being dramatic πŸ’€

πŸ’œ AUTHOR πŸ’œ

Timothy Legge <timlegge@gmail.com> β€” shoutout, legend behaviour 🌟


This software is copyright (c) 2026 by Venda Ltd, see the CONTRIBUTORS file for others. 🫢

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay πŸ’–


and that's the page, bestie ✨ this was perl v5.42.2, dated 2026-02-11 β€” go verify some XML, ily, bye πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from