Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

io::socket::ssl::utils(3) [mojave man page]

IO::Socket::SSL::Utils(3)				User Contributed Perl Documentation				 IO::Socket::SSL::Utils(3)

NAME
IO::Socket::SSL::Utils -- loading, storing, creating certificates and keys SYNOPSIS
use IO::Socket::SSL::Utils; my $cert = PEM_file2cert('cert.pem'); my $string = PEM_cert2string($cert); CERT_free($cert); my $key = KEY_create_rsa(2048); PEM_string2file($key); KEY_free($key); DESCRIPTION
This module provides various utility functions to work with certificates and private keys, shielding some of the complexity of the underlying Net::SSLeay and OpenSSL. FUNCTIONS
o Functions converting between string or file and certificates and keys. They croak if the operation cannot be completed. PEM_file2cert(file) -> cert PEM_cert2file(cert,file) PEM_string2cert(string) -> cert PEM_cert2string(cert) -> string PEM_file2key(file) -> key PEM_key2file(key,file) PEM_string2key(string) -> key PEM_key2string(key) -> string o Functions for cleaning up. Each loaded or created cert and key must be freed to not leak memory. CERT_free(cert) KEY_free(key) o KEY_create_rsa(bits) -> key Creates an RSA key pair, bits defaults to 1024. o CERT_asHash(cert) -> hash Extracts the information from the certificate into a hash: serial The serial number version Certificate version, usually 2 (x509v3) subject Hash with the parts of the subject, e.g. commonName, countryName, organizationName, stateOrProvinceName, localityName. subjectAltNames Array with list of alternative names. Each entry in the list is of "[type,value]", where "type" can be OTHERNAME, EMAIL, DNS, X400, DIRNAME, EDIPARTY, URI, IP or RID. not_before, not_after The time frame, where the certificate is valid, as time_t, e.g. can be converted with localtime or similar functions. o CERT_create(hash) -> (cert,key) Creates a certificate based on the given hash. Additionally to the information described in "CERT_asHash" the following keys can be given: CA true|false if true declare certificate as CA, defaults to false key key use given key as key for certificate, otherwise a new one will be generated and returned issuer_cert cert set issuer for new certificate issuer_key key sign new certificate with given key If not all necessary information are given some will have usable defaults, e.g. not_before defaults to the current time not_after defaults to 365 days in the future subject has a default pointing to IO::Socket::SSL version defaults to 2 (x509v3) serial will be a random number AUTHOR
Steffen Ullrich perl v5.18.2 2014-01-07 IO::Socket::SSL::Utils(3)

Check Out this Related Man Page

GENKEY(1)						      Cryptography Utilities							 GENKEY(1)

NAME
genkey - generate SSL certificates and certificate requests SYNOPSIS
genkey [--test] [--days count] [[--genreq] | [--makeca] | [--nss] | [--renew] | [--cacert]] {hostname} DESCRIPTION
genkey is an interactive command-line tool which can be used to generate SSL certificates or Certificate Signing Requests (CSR). Generated certificates are stored in the directory /etc/pki/tls/certs/, and the corresponding private key in /etc/pki/tls/private/. When using mod_nss the private key is stored in the nss database. Consult the nss.conf file in /etc/httpd/conf.d/ for the location of the database. genkey will prompt for the size of key desired; whether or not to generate a CSR; whether or not an encrypted private key is desired; the certificate subject DN details. genkey generates random data for the private key using the truerand library and also by prompting the user for entry of random text. nss indicates that mod_nss database should be used to store keys and certificates. OPTIONS
--makeca Generate a Certificate Authority keypair and certificate. --genreq Generate a Certificate Signing Request for an existing private key, which can be submitted to a CA (for example, for renewal). --renew Used with --genreq to indicate a renewal, the existing keypair will be used. Certs and keys must reside in the nss database, therefore --nss is also required. Pem file based cert renewal is not currently supported. --cacert The certificate renewal is for a CA, needed for openssl certs only. --days count When generating a self-signed certificate, specify that the number of days for which the certificate is valid be count rather than the default value of 30. --test For test purposes only; omit the slow process of generating random data. EXAMPLES
The following example will create a self-signed certificate and private key for the hostname www.example.com: # genkey --days 120 www.example.com The following example will create a self-signed certificate and private key for the hostname www.nssexample.com which will be stored in cert and key in the nss database. If no nickname is given the tool will extract it from mod_nss's nss configuration file. # genkey --days --nss 120 www.nssexample.com The following example will generate a certificate signing request for a new mod_nss style cert specified by its nickname, Server-Cert: # genkey --genreq --nss --days 120 Server-Cert The following example will generate a certificate signing request for the renewal of an existing mod_nss cert specified by its nickname, Server-Cert: # genkey --genreq --renew --nss --days 120 Server-Cert FILES
/etc/pki/tls/openssl.cnf SEE ALSO
certwatch(1), keyrand(1) crypto-utils 2.4.1 9 June 2014 GENKEY(1)
Man Page