Download the PHP package vdhicts/laravel-csr-generator without Composer

On this page you can find all versions of the php package vdhicts/laravel-csr-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-csr-generator

CSR generator

PHP offers several methods to help generate a CSR and private key. Unfortunately, some CSR parts (i.e. subject alternative names) are not easily usable. This Laravel package aims to make the procedure easier within your Laravel application.

Requirements

This Laravel package requires PHP 8.1 or higher, Laravel 9+ and you will need the openssl extension as that's required for the openssl_* php functions used by this package.

Installation

This package can be used in any Laravel project.

You can install the package via composer:

composer require vdhicts/laravel-csr-generator

Usage

This package is an easy-to-use wrapper around the PHP functions.

Getting started

All steps can be performed individually to suit all your needs.

Generate private key

The private key can be generated with the PrivateKeyGenerator. It's possible to manually determine the key bits and type. Additional options can be provided too. The generator will return null when failed or an instance of PrivateKey.

You can access the OpenSSLAsymmetricKey as a property.

Export private key as string

To convert the private key to a string, use the export method on the PrivateKey object or cast the object to a string:

Generate CSR

To generate the CSR, generate the private key and create the subject fields first. The generator will return null when failed or an instance of Csr.

You can access the OpenSSLCertificateSigningRequest as a property.

Subject alternative names & your own config

When providing subject alternative names, the config file from the additional options will be overwritten. This is required to provide the subject alternative names as those can't be provided directly to the openssl_ functions built in PHP. If you need to provide subject alternative names and a custom config, leave the subject alternative names in the SubjectFields empty and provide your config with the SAN section:

To help you create the config file, it's possible to publish the view for the config file. This view is used by default for generating the config with the subject alternative names.

Export CSR as string

To convert the CSR to a string, use the export method on the Csr object or cast the object to a string:

Custom configuration

Some defaults are set which are used by the generators. To change those defaults, publish the configuration file with:

Tests

Unit tests are available in the tests folder. Run with:

composer test

When you want a code coverage report which will be generated in the build/report folder. Run with:

composer test-coverage

Contribution

Any contribution is welcome, see the Contributing guidelines.

Security

If you discover any security-related issues in this or other packages of Vdhicts, please email [email protected] instead of using the issue tracker.

License

This package is open-sourced software licensed under the MIT license.

About Vdhicts

Vdhicts is the name of my company for which I work as a freelancer. Vdhicts develops and implements IT solutions for businesses and educational institutions.


All versions of laravel-csr-generator with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-openssl Version *
laravel/framework Version ^9.0|^10.0|^11.0
laravel/pint Version ^1.7
spatie/laravel-package-tools Version ^1.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vdhicts/laravel-csr-generator contains the following files

Loading the files please wait ....