aetah/jose

Generic PHP library for JOSE and compact JWS processing primitives

Maintainers

Package info

github.com/aetah/php-jose

pkg:composer/aetah/jose

Statistics

Installs: 290

Dependents: 0

Suggesters: 0

Stars: 0

0.1.0 2026-06-21 13:28 UTC

This package is not auto-updated.

Last update: 2026-06-22 12:06:43 UTC


README

This repository is a read-only split of aetah/php-openid-toolkit.

  • Development happens in the monorepo.
  • Feature PRs and issues should be opened against aetah/php-openid-toolkit.
  • This split repository is published from the monorepo and should not be treated as the source of truth.

JOSE

Generic PHP library for low-level JOSE and compact JWS processing primitives.

Scope

This package is designed as a reusable base for aetah/* libraries and CMS integrations. It provides:

  • base64url helpers for JOSE payloads
  • compact JWS parsing into typed header/payload/signature data
  • signing helpers for HS*, RS*, and EdDSA
  • verification helpers for PEM keys, shared secrets, JWKs, and JWKS sets
  • RSA JWK to PEM conversion for public-key verification

The package intentionally leaves token profile validation, claim policy, discovery, key persistence, and HTTP endpoint orchestration to host applications.

Install

composer require aetah/jose

Quick Start

<?php

declare(strict_types=1);

use Aetah\JOSE\JOSE;

$jose = new JOSE();

$jwt = $jose->sign(
    claims: ['sub' => '123', 'iss' => 'https://issuer.example'],
    algorithm: 'HS256',
    privateKey: 'shared-secret',
    kid: 'sig-1'
);

$parsed = $jose->verifyWithKey($jwt, 'shared-secret');

Spec

Spec Status

Missing/out of scope:

  • JWE encryption and decryption
  • X.509 certificate chain processing
  • remote JWKS retrieval and caching
  • OAuth or OpenID Connect claim validation profiles
  • detached payload and general JSON serialization handling

Quality Checks

Run Static Analysis

composer analyse

Run Tests

composer test

Generated artifacts are written under build/:

  • build/phpunit/ for JUnit reports
  • build/coverage/ for coverage output

Clean Build Artifacts

composer clean

Run Test Coverage

composer test:coverage

Run Style Checks

composer lint

Fix Style Checks

composer lint:fix

License

Licensed under AGPL-3.0-or-later. See LICENSE for details.