PHPackages                             alanmburr/self-signed-tls-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. alanmburr/self-signed-tls-generator

ActiveLibrary[Security](/categories/security)

alanmburr/self-signed-tls-generator
===================================

Quick &amp; dirty library to generate your own TLS certificates from your CA.

v1.1.2(2y ago)07MPL-2.0PHP

Since May 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alanmburr/self-signed-tls-generator)[ Packagist](https://packagist.org/packages/alanmburr/self-signed-tls-generator)[ RSS](/packages/alanmburr-self-signed-tls-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

SelfSignedTlsGenerator
======================

[](#selfsignedtlsgenerator)

*This library depends on a dev package. You may have to set your "minimim-stability" to "dev" in composer.json.*

1. Install and update Composer dependencies… `composer install` then `composer update`
2. Use…

    1. First, create a DistinguishedName class…

> ```
> $dn = new DistinguishedName("US", "Virginia", "Richmond", "org", false, "mynewawesometlsdomain.local", false);
> ```

2. Create a new CaInformation class…

    1. Inputs:

        1. Full file path to the CA (the certificate must be in PEM format)
        2. Full file path to the CA key
        3. Password for the CA key (in plaintext, only)

> ```
> $ca = new CaInformation(__DIR__."/ca.crt", __DIR__."/ca.key", "123abc");
> ```

3. Create a new SelfSignedTlsGenerator class…

    1. Inputs:

        1. DistinguishedName (required)
        2. OpenSSL Configuration (optional)

            1. Leave null or pass in null to use the default config.
        3. Per-domain OpenSSL Configuration (optional)

            1. If left blank, the class will generate a UUID (gen 5) from the Common Name portion of the Distinguished Name.
        4. Vendor OpenSSL Config Filename (optional)

            1. Defaults to `VendorConfig.cnf`. Pass in a full path if you have a custom config.

> ```
> $tlsgen = new SelfSignedTlsGenerator($dn);
> ```

4. Run the generateFromDN function of the SelfSignedTlsGenerator class…

    1. Inputs:

        1. CaInformation (required)
        2. Private Key bits (defaults to 2048)
        3. Days valid (defaults to 3650 (10 years), capped at 10 years)

            1. 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.
    2. Returns:

        1. An array of strings:

            1. The Private Key for the new certificate
            2. The Certificate contents.

> ```
> $crt = $tlsgen->generateFromDN($ca);
> print_r($crt);
> ```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

736d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3bd59e1d53945fde6f00453af8e073def3d9ba0453e4736d05bcff96a5d05d7a?d=identicon)[alanmburr](/maintainers/alanmburr)

---

Top Contributors

[![alanmburr](https://avatars.githubusercontent.com/u/54408289?v=4)](https://github.com/alanmburr "alanmburr (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alanmburr-self-signed-tls-generator/health.svg)

```
[![Health](https://phpackages.com/badges/alanmburr-self-signed-tls-generator/health.svg)](https://phpackages.com/packages/alanmburr-self-signed-tls-generator)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[genealabs/laravel-governor

Managing policy and control in Laravel.

201262.8k](/packages/genealabs-laravel-governor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
