The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::SSLeay::OO::X509::Name - methods to call on SSL certificate names

SYNOPSIS

 my $name = $cert->get_subject_name;

 # for 'common' attributes
 print "Summary of cert: ".$name->oneline."\n";
 print "Common name is ".$name->cn."\n";

 # others...
 use Net::SSLeay::OO::Constants qw(NID_pbe_WithSHA1And2_Key_TripleDES_CBC);
 my $val = $name->get_text_by_NID(NID_pbe_WithSHA1And2_Key_TripleDES_CBC);

DESCRIPTION

This object represents the X509_NAME structure in OpenSSL. It has a bunch of fields such as "common name", etc.

Two methods are imported from the OpenSSL library;

oneline

Returns a string, such as:

 /C=NZ/ST=Wellington/O=Catalyst IT/OU=Security/CN=Test Client
get_text_by_NID(NID_xxx)

Return a given field from the name. See openssl/objects.h for the complete list.

Convenience methods have been added which return the following common fields:

        cn           NID_commonName
        country      NID_countryName
        locality     NID_localityName
        state        NID_stateOrProvinceName
        org          NID_organizationName
        org_unit     NID_organizationalUnitName
        subject_key  NID_subject_key_identifier
        key_usage    NID_key_usage
        serial       NID_serialNumber

AUTHOR

Sam Vilain, samv@cpan.org

COPYRIGHT

Copyright (C) 2009 NZ Registry Services

This program is free software: you can redistribute it and/or modify it under the terms of the Artistic License 2.0 or later. You should have received a copy of the Artistic License the file COPYING.txt. If not, see <http://www.perlfoundation.org/artistic_license_2_0>

SEE ALSO

Net::SSLeay::OO, Net::SSLeay::OO::X509