.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "DN 3pm" .TH DN 3pm "2022-12-12" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" X500::DN \- handle X.500 DNs (Distinguished Names), parse and format them .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use X500::DN; \& \& my $dn = X500::DN\->ParseRFC2253 (\*(Aqcn=John Doe, o=Acme\e\e, Inc., c=US\*(Aq) or die; \& print $dn\->getRFC2253String(), "\en"; \& \& $dn = new X500::DN (new X500::RDN (\*(Aqc\*(Aq=>\*(AqUS\*(Aq), new X500::RDN (\*(Aqcn\*(Aq=>\*(AqJohn Doe\*(Aq)); \& my $rdn0 = $dn\->getRDN (0); \& my $c = $rdn0\->getAttributeValue (\*(Aqc\*(Aq); .Ve .SH "NOTE" .IX Header "NOTE" The \s-1RFC 2253\s0 syntax is \fIexplicitely backwards\fR in relation to the \s-1ASN.1 SEQUENCE.\s0 .PP So the \s-1RFC 2253\s0 string \f(CW\*(C`cn=John Doe, c=US\*(C'\fR has the same meaning as the X.500 string \f(CW\*(C`c=US, cn=John Doe\*(C'\fR. The X500::DN objects keep the RDNs in X.500 order! .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module handles X.500 DNs (Distinguished Names). Currently, it parses \s-1DN\s0 strings formatted according to \s-1RFC 2253\s0 syntax into an internal format and produces \s-1RFC 2253\s0 formatted string from it. .SS "Methods" .IX Subsection "Methods" .IP "\(bu" 4 \&\f(CW$object\fR = new X500::DN (rdn, rdn, ...); .Sp Creates a \s-1DN\s0 object from zero or more arguments of type X500::RDN. .IP "\(bu" 4 \&\f(CW$object\fR = X500::DN\->ParseRFC2253 ('cn=John Doe, o=Acme\e\e, Inc., c=US'); .Sp Creates a \s-1DN\s0 object from an \s-1RFC 2253\s0 formatted \s-1DN\s0 string notation. .IP "\(bu" 4 \&\f(CW$object\fR\->\fBgetRFC2253String()\fR; .Sp Returns the \s-1DN\s0 as a string formatted according to \s-1RFC 2253\s0 syntax. .IP "\(bu" 4 \&\f(CW$object\fR\->\fBgetOpenSSLString()\fR; .Sp Returns the \s-1DN\s0 as a string formatted suitable for \f(CW\*(C`openssl req \-subj\*(C'\fR and \f(CW\*(C`openssl ca \-subj\*(C'\fR. .IP "\(bu" 4 \&\f(CW$object\fR\->\fBgetX500String()\fR; .Sp Returns the \s-1DN\s0 as a string formatted according to X.500 syntax. \&\s-1NOTE:\s0 This is a hack, there is no definition for a X.500 string syntax! .IP "\(bu" 4 \&\f(CW$object\fR\->\fBhasMultivaluedRDNs()\fR; .Sp Returns whether the \s-1DN\s0 contains multi-valued RDNs. .IP "\(bu" 4 \&\f(CW$object\fR\->getRDN (num); .Sp Returns the \s-1DN\s0's \s-1RDN\s0 at position num as an X500::RDN object. num starts with 0, which will return the first \s-1RDN\s0 in \s-1ASN.1 SEQUENCE\s0 order. .IP "\(bu" 4 \&\f(CW$object\fR\->\fBgetRDNs()\fR; .Sp Returns the \s-1DN\s0's RDNs, a list of objects of type X500::RDN, in \s-1ASN.1 SEQUENCE\s0 order. .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" None. .SH "BUGS" .IX Header "BUGS" .IP "\(bu" 4 Due to Parse::RecDescent's greedyness, white space after attribute values gets into the parsed value. It might be possible to work around this. .SH "AUTHOR" .IX Header "AUTHOR" Robert Joop .SH "COPYRIGHT" .IX Header "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. .SH "SEE ALSO" .IX Header "SEE ALSO" X500::RDN, perl. .SH "HISTORY" .IX Header "HISTORY" .IP "Early 2002: First idea, discussed on comp.lang.perl.moderated" 4 .IX Item "Early 2002: First idea, discussed on comp.lang.perl.moderated" .PD 0 .IP "April 2002: First public release, 0.15" 4 .IX Item "April 2002: First public release, 0.15"