Manage the creation of certificates. Allow to create a Certificate Authority and sign the childs certificates.
It allow to manage the CSR (Certificate Signing Request), allow alternate names, create private keys if needed
$certificationauthority = new Domframework\Certificationauthority ();
$certificationauthority->createCA ("FR", "FOURNIER38", "CATEST");
$caCert = $certificationauthority->caCert ();
$caKey = $certificationauthority->caKey ();
$certificationauthority = new Domframework\Certificationauthority ();
$csr = $certificationauthority->createCSR ("FR", "FOURNIER38",
"COMPUTER.fournier38.fr");
$key = $certificationauthority->privateKey ();
$certificationauthority = new Domframework\Certificationauthority ();
$certificationauthority->caKey ("The PEM CA key");
$certificationauthority->caCert ("The PEM CA Cert");
$cert = $certificationauthority->signCSR ($csr, $caCert, $caKey);
$certificationauthority = new Domframework\Certificationauthority ();
$certificationauthority->caKey ("The PEM CA key");
$certificationauthority->caCert ("The PEM CA Cert");
$cert = $certificationauthority->signCSR ($csr, $caCert, $caKey, 365 * 2);
$certificationauthority = new Domframework\Certificationauthority ();
$certificationauthority->caKey ("The PEM CA key");
$certificationauthority->caCert ("The PEM CA Cert");
$cert = $certificationauthority->signCSR ($csr, $caCert, $caKey, 365 * 2,
["ALT1.example.com","ALT2.example.com"]);Namespace Domframework
/** An certificate authority
No property available
/** Check if openssl support is available in PHP
/** Remove the temporary files when destroying the object
/** Get/Set the ca cert@param string|null $caCertThe CA cert to get/set@return($caCert is null ? string : $this) the CA if get in PEM, $this if set
/** Get/Set the ca key@param string|null $caKeyThe CA key to get/set@return($caKey is null ? string : $this) the CA if get, $this if set
/** Create the pair key/cert for authority@param string $countryNameCountry name (like FR)@param string $organizationNameName of organization@param string $commonNameCommon name of authority@param integer|null $daysThe number of days of validity of the CA (3650 by default)@return$this
/** Create a CSR. Will create a private key if none is already exists@param string $countryNameCountry name (like FR)@param string $organizationNameName of organization@param string $commonNameCommon name of authority@returnstring the CSR created in PEM
/**
Create a private key
@return $this;
/** Get in PEM/Set the private key@param string|null $privateKeyThe private key to use@return($privateKey is null ? string : $this) the privatekey if get in PEM, $this if set
/** Sign a CSR with an CA cert/key pair and return the signed certificate in PEM mode The caCert and caKey must be defined@param string $csrThe CSR to sign@param string $caCertThe CA Certificate@param string $caKeyThe CA private key@param integer|null $daysThe number of days of validity (365 by default)@param array|null $altNamesThe alternative names allowed in cert@returnstring the signed certificate in PEM