PHPackages                             knik/x509 - 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. knik/x509

ActiveLibrary[Security](/categories/security)

knik/x509
=========

A PHP library for X.509 public key certificates, attribute certificates, certification requests and certification path validation.

0.6.2(7y ago)06.5k—0%MITPHPPHP &gt;=7.0

Since May 2Pushed 7y agoCompare

[ Source](https://github.com/et-nik/x509)[ Packagist](https://packagist.org/packages/knik/x509)[ Docs](https://github.com/sop/x509)[ RSS](/packages/knik-x509/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (14)Used By (0)

[![Build Status](https://camo.githubusercontent.com/7ab15c9b61735a8498b0f6e40e6872317163b454cb11a3688d04043416e9e61b/68747470733a2f2f7472617669732d63692e6f72672f65742d6e696b2f783530392e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/et-nik/x509)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/eeb93b2a303eff42591ab1c9ffe285b5f10734ad8b29f7986de208fa2a14e2c8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65742d6e696b2f783530392f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/et-nik/x509/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/5e8ef6800e591b27089deb2bec537b2b128f301897ab0cbf886d3df2f6c742ae/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f65742d6e696b2f783530392f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/et-nik/x509?branch=master)[![License](https://camo.githubusercontent.com/9859eac10d2f39d92082b272597de4a621c0e5da187b99578cd132b5ac2ce4ef/68747470733a2f2f706f7365722e707567782e6f72672f65742d6e696b2f783530392f6c6963656e7365)](https://github.com/et-nik/x509/blob/master/LICENSE)

X.509
=====

[](#x509)

A PHP library for X.509 public key certificates, attribute certificates, certification requests and certification path validation.

Introduction
------------

[](#introduction)

This library provides a pure PHP implementation of X.509 certificates. The class hierarchy adapts to the ASN.1 types, which makes it easy to use corresponding RFC's as a reference documentation.

Features
--------

[](#features)

- X.509 certificates ([RFC 5280](https://tools.ietf.org/html/rfc5280))
    - Certificate decoding and encoding
    - Certificate signing
- Certification requests ([PKCS #10](https://tools.ietf.org/html/rfc2986))
    - CSR decoding and encoding
- Certification path
    - Path building
    - Path validation
- Attribute certificates ([RFC 5755](https://tools.ietf.org/html/rfc5755))
    - AC decoding and encoding
    - AC signing

Requirements
------------

[](#requirements)

- PHP &gt;=7.0
- gmp
- [sop/asn1](https://github.com/sop/asn1)
- [sop/x501](https://github.com/sop/x501)
- [sop/crypto-types](https://github.com/sop/crypto-types)
- [sop/crypto-bridge](https://github.com/sop/crypto-bridge)
- [sop/crypto-encoding](https://github.com/sop/crypto-encoding)

Installation
------------

[](#installation)

This library is available on [Packagist](https://packagist.org/packages/et-nik/x509).

```
composer require knik/x509

```

Code examples
-------------

[](#code-examples)

Examples are located in [`/examples`](https://github.com/et-nik/x509/tree/master/examples)directory.

- [Create a CA certificate](https://github.com/et-nik/x509/blob/master/examples/create-ca-cert.php)
- [Create a CSR](https://github.com/et-nik/x509/blob/master/examples/create-csr.php)
- [Issue a certificate](https://github.com/et-nik/x509/blob/master/examples/issue-cert.php)
- [Validate a certification path](https://github.com/et-nik/x509/blob/master/examples/path-validate.php)

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.5% 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 ~86 days

Recently: every ~215 days

Total

13

Last Release

2619d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.6.3

0.6.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7469ba20a83b18557bde2a09acd47b9b0ee91657f73b35789c5367fbe94dd19?d=identicon)[knik](/maintainers/knik)

---

Top Contributors

[![sop](https://avatars.githubusercontent.com/u/1017000?v=4)](https://github.com/sop "sop (197 commits)")[![et-nik](https://avatars.githubusercontent.com/u/3670640?v=4)](https://github.com/et-nik "et-nik (5 commits)")

---

Tags

x509certificatecsrattribute certificateaccertification request

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/knik-x509/health.svg)

```
[![Health](https://phpackages.com/badges/knik-x509/health.svg)](https://phpackages.com/packages/knik-x509)
```

###  Alternatives

[sop/x509

A PHP library for X.509 public key certificates, attribute certificates, certification requests and certification path validation.

45884.0k10](/packages/sop-x509)[spomky-labs/pki-framework

A PHP framework for managing Public Key Infrastructures. It comprises X.509 public key certificates, attribute certificates, certification requests and certification path validation.

2725.9M11](/packages/spomky-labs-pki-framework)[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[acmephp/core

Raw implementation of the ACME protocol in PHP

38973.7k7](/packages/acmephp-core)[acmephp/ssl

PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features

141.2M4](/packages/acmephp-ssl)[acmephp/acmephp

Let's Encrypt client written in PHP

649155.1k](/packages/acmephp-acmephp)

PHPackages © 2026

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