PHPackages                             sop/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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. sop/x509

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

sop/x509
========

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

0.7.1(5y ago)45884.0k↓19.2%14[4 PRs](https://github.com/sop/x509/pulls)10MITPHPPHP &gt;=7.2

Since May 2Pushed 2y ago2 watchersCompare

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

READMEChangelog (2)Dependencies (6)Versions (17)Used By (10)

X.509
=====

[](#x509)

[![Build Status](https://camo.githubusercontent.com/40c41bc090e23cd4c6736ad44579f0612059df884e09e4035f658a432dfffb96/68747470733a2f2f7472617669732d63692e6f72672f736f702f783530392e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sop/x509)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8dc5c450fc9a5b23674b63c918944e3da324580f82ba99e7639804bdfe44fc7d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f702f783530392f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sop/x509/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/775486d327221ff25cd7859d9a87199eb7feffc96230a8407a80a2a249de5b1d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736f702f783530392f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/sop/x509?branch=master)[![License](https://camo.githubusercontent.com/cea3c154142c968999c8b85a073f05bc84edf6bd0ae3c4075fd5681bc165f61f/68747470733a2f2f706f7365722e707567782e6f72672f736f702f783530392f6c6963656e7365)](https://github.com/sop/x509/blob/master/LICENSE)

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.2
- 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/sop/x509).

```
composer require sop/x509

```

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

[](#code-examples)

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

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

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity56

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 ~202 days

Recently: every ~570 days

Total

15

Last Release

834d ago

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

0.6.0PHP &gt;=7.0

0.7.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/35cf70dd6be68d37fd42490e3ad9c199d2a1f1dd4420f71658998b7d8b694e97?d=identicon)[sop](/maintainers/sop)

---

Top Contributors

[![sop](https://avatars.githubusercontent.com/u/1017000?v=4)](https://github.com/sop "sop (216 commits)")

---

Tags

attribute-certificatescertificate-requestcertificate-signing-requestcertificatescertification-pathdecodingencodingparserx509x509certificatecsrattribute certificateaccertification request

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[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)[acmephp/acmephp

Let's Encrypt client written in PHP

649155.1k](/packages/acmephp-acmephp)[kelunik/certificate

Access certificate details and transform between different formats.

11038.3M8](/packages/kelunik-certificate)[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)[lsnepomuceno/laravel-a1-pdf-sign

Sign PDF files with valid x509 certificates

315101.4k](/packages/lsnepomuceno-laravel-a1-pdf-sign)

PHPackages © 2026

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