1. Go to this page and download the library: Download spatie/ssl-certificate library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spatie / ssl-certificate example snippets
use Spatie\SslCertificate\SslCertificate;
// fetch the certificate using an url
$certificate = SslCertificate::createForHostName('spatie.be');
// or from a certificate file
$certificate = SslCertificate::createFromFile($pathToCertificateFile);
// or from a string
$certificate = SslCertificate::createFromString($certificateData);
$certificate->isValid(); // returns true if the certificate is currently valid
$certificate->expirationDate(); // returns a Carbon instance Carbon
$certificate->validFromDate(); // returns a Carbon instance Carbon
$certificate->daysUntilExpirationDate(); // returns the amount of days between today and expirationDate
$certificate->lifespanInDays(); // return the amount of days between validFromDate and expirationDate
$certificate->getIssuer(); // returns "Let's Encrypt Authority X3"
$certificate->getOrganization(); // returns the organization name when available
$certificate->getPublicKeyAlgorithm(); // returns the public key algorithm
$certificate->getPublicKeySize(); // returns the public key algorithm
$certificate->getSignatureAlgorithm(); // returns the signature algorithm