NAME
No::Worries::DN - Distinguished Names handling without worries
SYNOPSIS
use No::Worries::DN qw(dn_parse dn_string);
$dn = dn_parse("/C=US/O=Acme Corporation/CN=John Doe");
$string = dn_string($dn, No::Worries::DN::FORMAT_JAVA);
DESCRIPTION
This module eases Distinguished Names (DNs) handling by providing convenient functions to parse and convert DNs from and to different formats. All the functions die() on error.
FUNCTIONS
This module provides the following functions (none of them being exported by default):
- dn_parse(STRING)
-
parse a string containing DN information and return an array reference
- dn_string(DN, FORMAT)
-
convert the given parsed DN (an array reference) into a string of the given format, this is somehow the opposite of dn_parse()
FORMATS
Here are the supported formats:
- No::Worries::DN::FORMAT_RFC2253
-
this is the format defined by RFC 2253, for instance:
CN=John Doe,O=Acme Corporation,C=US
- No::Worries::DN::FORMAT_JAVA
-
this is a variant of RFC 2253, with extra spaces, for instance:
CN=John Doe, O=Acme Corporation, C=US
- No::Worries::DN::FORMAT_OPENSSL
-
this is the default format used by OpenSSL, for instance:
/C=US/O=Acme Corporation/CN=John Doe
SEE ALSO
AUTHOR
Lionel Cons http://cern.ch/lionel.cons
Copyright (C) CERN 2012-2019