Download the PHP package evilfreelancer/easyrsa-php without Composer
On this page you can find all versions of the php package evilfreelancer/easyrsa-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download evilfreelancer/easyrsa-php
More information about evilfreelancer/easyrsa-php
Files in evilfreelancer/easyrsa-php
Package easyrsa-php
Short Description An easy way to use the official EasyRSA collection of shell scripts in your application
License MIT
Informations about the package easyrsa-php
EasyRSA wrapper for PHP
An easy way to use the official EasyRSA collection of shell scripts in your application.
composer require evilfreelancer/easyrsa-php
By the way, EasyRSA library support Laravel and Lumen frameworks, details here.
How to use
More examples you can find here.
Download the latest release of EasyRSA
Before you start use this script need to download the easy-rsa package.
Result of this script will be in easy-rsa
folder.
Generate certificates
Result of this script will be in easy-rsa-certs
folder.
List of all available commands
Method | Description |
---|---|
getContent(string $filename) | Show content of any certificate available in "certs" folder |
initPKI() | Instantiate Public Key Infrastructure (PKI) |
buildCA(bool $nopass = false) | Build Certificate Authority (CA) |
genDH() | Generate Diffie-Hellman certificate (DH) |
genReq() | Generate request for certificate |
signReqClient(string $filename) | Sign request for client certificate |
signReqServer(string $filename) | Sign request for server certificate |
buildClientFull(string $name, bool $nopass = false) | Build public and private key of client |
buildServerFull(string $name, bool $nopass = false) | Build public and private key of server |
revoke(string $filename) | Revoke certificate |
genCRL() | Generate Certificate Revocation List (CRL) |
updateDB() | Update certificates database |
showCert(string $filename) | Display information about certificate |
showReq(string $filename) | Display information about request |
importReq(string $filename) | Import request |
exportP7(string $filename) | Export file in format of Public-Key Cryptography Standards (PKCS) v7 (P7) |
exportP12(string $filename) | Export file in format of Public-Key Cryptography Standards (PKCS) v12 (P12) |
setRSAPass(string $filename) | Set password in Rivest–Shamir–Adleman (RSA) format |
setECPass(string $filename) | Set password in Elliptic Curve (EC) format |
You also can read content of generated certificate via getConfig($filename)
method:
Environment variables
You can set these variables via environment on host system or with help of vlucas/phpdotenv library or via any other way which you like.
Example of environment variables configuration which should be used on certificate build stage can be fond here.
Frameworks support
Laravel
The package's service provider will automatically register its service provider.
Publish the easy-rsa.php
configuration file:
Alternative configuration method via .env file
After you publish the configuration file as suggested above, you may configure library
by adding the following to your application's .env
file (with appropriate values):
Lumen
If you work with Lumen, please register the service provider and configuration in bootstrap/app.php
:
Manually copy the configuration file to your application.
Testing
This library can tested in multiple different ways
or just in one command