GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DN(3) User Contributed Perl Documentation DN(3)

X500::DN - handle X.500 DNs (Distinguished Names), parse and format them

  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');

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". The X500::DN objects keep the RDNs in X.500 order!

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.

  • $object = new X500::DN (rdn, rdn, ...);

    Creates a DN object from zero or more arguments of type X500::RDN.

  • $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 for "openssl req -subj" and "openssl ca -subj".

  • $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!

  • $object->hasMultivaluedRDNs();

    Returns whether the DN contains multi-valued RDNs.

  • $object->getRDN (num);

    Returns the DN's RDN at position num as an X500::RDN object. num starts with 0, which will return the first RDN in ASN.1 SEQUENCE order.

  • $object->getRDNs();

    Returns the DN's RDNs, a list of objects of type X500::RDN, in ASN.1 SEQUENCE order.

None.

Due to Parse::RecDescent's greedyness, white space after attribute values gets into the parsed value. It might be possible to work around this.

Robert Joop <yaph-070708@timesink.de>

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.

X500::RDN, perl.

Early 2002: First idea, discussed on comp.lang.perl.moderated
April 2002: First public release, 0.15
2007-07-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.