Download the PHP package alanmburr/self-signed-tls-generator without Composer
On this page you can find all versions of the php package alanmburr/self-signed-tls-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alanmburr/self-signed-tls-generator
More information about alanmburr/self-signed-tls-generator
Files in alanmburr/self-signed-tls-generator
Package self-signed-tls-generator
Short Description Quick & dirty library to generate your own TLS certificates from your CA.
License MPL-2.0
Informations about the package self-signed-tls-generator
SelfSignedTlsGenerator
This library depends on a dev package. You may have to set your "minimim-stability" to "dev" in composer.json.
-
Install and update Composer dependencies…
composer install
thencomposer update
-
Use…
- First, create a DistinguishedName class…
-
Create a new CaInformation class…
-
Inputs:
-
Full file path to the CA (the certificate must be in PEM format)
-
Full file path to the CA key
- Password for the CA key (in plaintext, only)
-
-
-
Create a new SelfSignedTlsGenerator class…
-
Inputs:
-
DistinguishedName (required)
-
OpenSSL Configuration (optional)
- Leave null or pass in null to use the default config.
-
Per-domain OpenSSL Configuration (optional)
- If left blank, the class will generate a UUID (gen 5) from the Common Name portion of the Distinguished Name.
-
Vendor OpenSSL Config Filename (optional)
- Defaults to
VendorConfig.cnf
. Pass in a full path if you have a custom config.
- Defaults to
-
-
-
Run the generateFromDN function of the SelfSignedTlsGenerator class…
-
Inputs:
-
CaInformation (required)
-
Private Key bits (defaults to 2048)
-
Days valid (defaults to 3650 (10 years), capped at 10 years)
- Capped at 10y because some browsers reject certificates that are valid for more than a decade. I haven't encountered this, and it seems like neither have other people, but it's a theoretical limitation to be aware of.
-
-
Returns:
-
An array of strings:
-
The Private Key for the new certificate
- The Certificate contents.
-
-
-