Ssl_Module

Provides SSL certificate management for Apache
extends Module\Skeleton\Standard implements Opcenter\Contracts\Hookable
Methods Summary
public
public
# cert_exists( )
Check if certificate is installed for account
public
# get_certificates( )
Get certificate names installed on account
public
# key_exists( $key = 'server.key' )
public
# install( $key , $cert , $chain = NULL )
public
public
# valid( string $cert , string $pkey )
Verify that the named certificate and key
public
# is_self_signed( $crt )
Check if certificate issuer matches requestor
public
# self_sign( string $cn , array $sans = array ( ) )
Create a self-signed certificate
public
# parse_certificate( mixed $crt )
Parse certificate and return information
public
# resolve_chain( string $crt )
Resolve a certificate chain, downloading certificates as necessary
public
# verify_certificate_chain( mixed $cert1 , mixed $cert2 )
Verify cert2 is a chain to cert1
public
# enabled( )
public
# delete( $key , $crt , $chain = NULL )
public
# get_certificate( string $name = 'server.crt' )
Get raw certificate
public
# get_private_key( $name = 'server.key' )
public
# generate_privatekey( int $bits = 2048 )
Generate new private key
public
# generate_csr( string $privkey , string $host , string $country = '', string $state = '', string $locality = '', string $org = '', string $orgunit = '', string $email = '', array $san = array ( ) )
Generate certificate signing request for a CA
public
# request_info( string $csr )
Get certificate signing request parameters Sample response: array(7) { ["C"]=> string(2) "US" ["ST"]=> string(7) "Georgia" ["L"]=> string(7) "Lilburn" ["O"]=> string(13) "Apis Networks" ["OU"]=> string(4) "Test" ["CN"]=> string(8) "test.com" ["emailAddress"]=> string(25) "msaladna@apisnetworks.com" }
public
# get_public_key( string $name )
Get public key from certificate Array ( [bits] => 4096 [key] => -----BEGIN PUBLIC KEY----- ... ... [rsa] => Array ( [n] => .., [e] => ..,) [type] => 0
public
# order_certificates( array $certs )
Order a mixed arrangement of certificates in ascending order to root
public
# get_csr( $name )
public
# sign_certificate( string $csr , string $privkey , int $days = 365, float $serial = NULL )
Create a self-signed certificate
public
# verify_x509_key( string $crt , string $privkey )
Verify the given private key matches the self-signed certificate
public
# verify_key( $key )
public
# privkey_info( $privkey )
Get private key details
public
# get_alternative_names( resource|string $certificate )
Get hostnames for which a certificate is valid
public
public
# contains_cn( string $name )
Active certificate contains name
public
public
# _verify_conf( Opcenter\Service\ConfigurationContext $ctx )
public
public
public
public
# _edit_user( string $userold , string $usernew , array $oldpwd )
Methods inherited from Module\Skeleton\Standard
__construct(), setUserParameters(), autoloadModule(), __wakeup(), _invoke(), __debugInfo(), getExportedFunctions(), _reset(), cleanUserParameters(), query()
Constants Summary
public array DEPENDENCY_MAP
# array ( 0 => 'apache', 1 => 'siteinfo', )
public string CRT_PATH
# '/etc/httpd/conf/ssl.crt'
public string KEY_PATH
# '/etc/httpd/conf/ssl.key'
public string CSR_PATH
# '/etc/httpd/conf/ssl.csr'
public string DEFAULT_CERTIFICATE_NAME
# 'server'
public int X509_DAYS
# 1095
public string USER_RHOOK
# 'letsencrypt'
public string SYS_RHOOK
# 'ssl'
Constants inherited from Module\Skeleton\Standard
DEPENDENCY_MAP
Properties inherited from Module\Skeleton\Standard
$exportedFunctions, $username, $password, $domain, $user_id, $group_id, $permission_level, $session_id, $site, $site_id