Authen:...l::x509(3)

πŸ“¦
version 1.2 Β· 3 versions
, in fedora 43

πŸ’– Authen::Credential::x509 β€” the manual, but make it cute ✨

okay bestie, welcome to section 3 of the manual pages, and today's main character is Authen::Credential::x509 πŸŽ€ she's a little helper module, she's got a whole personality, and she's here to make X.509 credentials make sense. periodt.


🌸 NAME 🌸

Authen::Credential::x509 β€” an abstraction of an X.509 credential. it's giving "I hold your cert stuff so you don't have to" πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is a helper module for Authen::Credential, and what it does is implement an X.509 credential. if you wanna know what X.509 even is, the original is like, go read <http://en.wikipedia.org/wiki/X.509> β€” that's the vibe check source right there.

it supports the following attributes, and yes, we're listing every single one, no skipping πŸ™…β€β™€οΈ

  • cert β€” the path of the file holding the certificate. that's the whole point bestie, it's literally in the name πŸ“
  • key β€” the path of the file holding the private key. guard this one with your life fr fr πŸ”₯
  • pass β€” the pass-phrase protecting the private key. it's optional! ✨
  • ca β€” the path of the directory containing trusted certificates. also optional πŸ’œ
  • ca_file β€” the path of the file that contains the trusted certificate. optional too πŸŽ€

and it supports the following targets for the prepare() method:

  • IO::Socket::SSL β€” it returns a reference to a hash containing the suitable options for IO::Socket::SSL. like, you ask nicely, it hands you a hashref all ready to go 🫢

🌈 EXAMPLE 🌈

here's the moment you've been waiting for, the code, the iconic snippet, the main character scene:

use Authen::Credential;
use IO::Socket::SSL;

# get the credential from somewhere
$cred = Authen::Credential->parse(...);

# use the prepare() method to get ready-to-use data
$sslopts = $cred->prepare("IO::Socket::SSL");
$socket = IO::Socket::SSL->new(
    PeerHost => "web.acme.com",
    PeerPort => "https",
    %{ $sslopts },
);

see how the prepare("IO::Socket::SSL") call just dumps those ready-to-use options straight into your socket constructor? obsessed. πŸ˜­πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

go look at these when you're done here, bestie:

iykyk πŸ’…


🌸 AUTHOR 🌸

Lionel Cons <http://cern.ch/lionel.cons> β€” icon, legend, wrote the thing πŸ‘‘

Copyright (C) CERN 2011-2015 🫢


and that's a wrap on this page, babe. this one shipped as perl v5.42.0, dated 2025-07-25, and yes the header kept doing that cute little truncation thing with the module name β€” we fixed the vibe, not the facts. mwah πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from