skriptfabrik/openssl

A PHP package to manage key files with OpenSSL

dev-master / 1.0.x-dev 2024-06-28 07:40 UTC

This package is auto-updated.

Last update: 2024-10-28 08:25:39 UTC


README

Build Status Coverage Status

Usage

Run $ vendor/bin/openssl help [<command_name>] to display the usage details for a specific command.

Generate a private key

The default private key file with the name private.pem will be generated to the current working directory. You can specify the --type, --bits and --passphrase as an option. If you want to keep an existing private key, append the --no-override option to the command.

$ vendor/bin/openssl openssl:generate-private-key [options] [--] [<output>]

Export the public key

The default public key file with the name public.pem will be exported to the current working directory. The private key is expected to be named private.pem. It should also be stored in the working directory per default. Use the --passphrase option when the private key was encrypted by a passphrase. If you want to keep an existing public key, append the --no-override option to the command.

$ vendor/bin/openssl openssl:export-public-key [options] [--] [<input> [<output>]]

Development

Requirements

The development of this project is powered by Docker, Docker Compose and GNU Make. Please have a look at the Makefile for exact commands.

Install dependencies and development tools

This will install all Composer dependencies and development tools.

$ make install

Analyse code

The code analysis is being performed with PHPStan.

$ make analysis

Check code style

The code style is being checked with PHP_CodeSniffer.

$ make style-check

Fix code style

Some minor code style issues can also be fixed with PHP_CodeSniffer.

$ make style-fix

Run Tests

PHPUnit is being used to run the test suite.

$ make tests

Run Tests With Coverage

To display and export the coverage report add -with-coverage.

$ make tests-with-coverage

License

The MIT License (MIT). Please see License File for more information.