DN(3pm)
π X500::DN β DN(3pm) π
okay bestie, so this is the manual page for X500::DN, a Perl module that handles X.500 DNs (Distinguished Names) β it parses them and formats them, and it's giving extremely niche but extremely useful π
β¨ NAME β¨
X500::DN β handle X.500 DNs (Distinguished Names), parse and format them. no cap, that's the whole job description π«Ά
π SYNOPSIS π
use X500::DN;
my $dn = X500::DN->ParseRFC2253 ('cn=John Doe, o=Acme\\, Inc., c=US') or die;
print $dn->getRFC2253String(), "\n";
$dn = new X500::DN (new X500::RDN ('c'=>'US'), new X500::RDN ('cn'=>'John Doe'));
my $rdn0 = $dn->getRDN (0);
my $c = $rdn0->getAttributeValue ('c');
look at her go π she's parsing AND formatting AND being iconic about it
π¦ NOTE π¦
bestie this part is so important, listen up π
The RFC 2253 syntax is explicitely backwards in relation to the ASN.1 SEQUENCE.
So the RFC 2253 string "cn=John Doe, c=US" has the same meaning as the X.500 string "c=US, cn=John Doe". And the X500::DN objects keep the RDNs in X.500 order!
fr fr, it's reversed. it's giving "walked in backwards on purpose". don't let it catch you off guard π
πΈ DESCRIPTION πΈ
This module handles X.500 DNs (Distinguished Names). Currently, it parses DN strings formatted according to RFC 2253 syntax into an internal format and produces RFC 2253 formatted string from it.
lowkey a glow-up pipeline: string in, object out, string out again β¨
π Methods π
$object = new X500::DN (rdn, rdn, ...);β Creates a DN object from zero or more arguments of typeX500::RDN. zero args? valid. she's flexible like that π$object = X500::DN->ParseRFC2253 ('cn=John Doe, o=Acme\\, Inc., c=US');β Creates a DN object from an RFC 2253 formatted DN string notation.$object->getRFC2253String();β Returns the DN as a string formatted according to RFC 2253 syntax.$object->getOpenSSLString();β Returns the DN as a string formatted suitable foropenssl req -subjandopenssl ca -subj. yes, that openssl π§$object->getX500String();β Returns the DN as a string formatted according to X.500 syntax.
NOTE: This is a hack, there is no definition for a X.500 string syntax! she said it herself, don't come for her π
$object->hasMultivaluedRDNs();β Returns whether the DN contains multi-valued RDNs. yes/no, simple, we love a yes/no queen π$object->getRDN (num);β Returns the DN's RDN at position num as anX500::RDNobject. num starts with0, which will return the first RDN in ASN.1 SEQUENCE order. zero-indexed besties, we start at 0 here β$object->getRDNs();β Returns the DN's RDNs, a list of objects of typeX500::RDN, in ASN.1 SEQUENCE order.
π EXPORT π
None. nothing jumps out at you, no surprise imports, no chaos. she's self-contained, periodt π
π BUGS π
- Due to
Parse::RecDescent's greedyness, white space after attribute values gets into the parsed value. It might be possible to work around this.
ngl she's a little greedy π it's giving "took the whitespace too, sorry bestie". it might be possible to work around this, but that's a future era π
π AUTHOR π
Robert Joop <yaph-070708@timesink.de>
the main character who wrote her π«Ά
π COPYRIGHT π
Copyright 2002 Robert Joop. All Rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π SEE ALSO π
X500::RDNβ her bestie, the other half of the duo πperlβ the whole reason we're here, obviously πΈ
β HISTORY β
- Early 2002: First idea, discussed on
comp.lang.perl.moderated - April 2002: First public release,
0.15
okay that's the whole page bestie, every flag, every method, every vibe, fully intact, no notes π iykyk
signing off: this was perl v5.36.0, dated 2022-12-12, and the manual page you just read is DN(3pm) π¦β¨
π¦ where this page comes from
- debian bookworm: libx500-dn-perl 0.29-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libx500-dn-perl 0.29-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libx500-dn-perl 0.29-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libx500-dn-perl 0.29-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libx500-dn-perl 0.29-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms