For the complete documentation index, see llms.txt. This page is also available as Markdown.

Provided Features

Supported Input Types

JWS or JWE objects support every input that can be encoded into JSON:

  • string, array, integer, float...

  • Objects that implement the \JsonSerializable interface such as JWK or JWKSet

The detached payload is supported.

Supported Serialization Modes

Serialization syntax
JWS
JWE

Compact

YES

YES

Flattened JSON

YES

YES

General JSON

YES

YES

Supported Compression Methods

Supported Key Types (JWK)

Key Type
Supported
Comment

oct

YES

Symmetric keys

RSA

YES

RSA based asymmetric keys

EC

YES

Elliptic Curves based asymmetric keys

OKP

YES

Octet Key Pair based asymmetric keys

JWK objects support JSON Web Key Thumbprint (RFC 7638).

A none key type is available for the none algorithm. It is used to explicitly allow this unsecured algorithm.

Supported Elliptic Curves

Key Type
Curve
Supported
Comment

EC

P-256

P-384

P-521

YES

ECDSA signatures (ES256/ES384/ES512) and ECDH-ES*/ECDH-SS* key agreement

EC

secp256k1

YES

ES256K, in the Jose\Experimental namespace

EC

BP-256

BP-384

BP-512

YES

Brainpool curves. BP256R1/BP384R1/BP512R1 signatures are in the Jose\Experimental namespace

OKP

Ed25519

YES

EdDSA signatures. SODIUM extension is required

OKP

X25519

YES

ECDH-ES* key agreement. SODIUM extension is required

OKP

Ed448

X448

NO

No extension or built-in implementation available

Key Sets (JWKSet)

JWKSet is fully supported.

Supported Signature Algorithms

Signature Algorithm
Supported
Comment

HS256

HS384

HS512

YES

ES256

ES384

ES512

YES

RS256

RS384

RS512

YES

PS256

PS384

PS512

YES

GMP or BCMath extension is highly recommended

EdDSA with Ed25519 curve

YES

SODIUM extension is required

EdDSA with Ed448 curve

NO

No extension or built-in implementation available

none

YES

Please note that this is not a secured algorithm. USE IT WITH CAUTION!

Other signature algorithms like RS1, HS1, HS256/64, ES256K, BP256R1, BP384R1, BP512R1 and Blake2b are also available in the Jose\Experimental namespace. These algorithms should be used for testing purposes only or for compatibility with old systems.

Supported Key Encryption Algorithms

Key Encryption Algorithm
Supported

dir

YES

RSA1_5

RSA-OAEP

RSA-OAEP-256

YES

GMP or BCMath extension is highly recommended Read note below!

ECDH-ES

ECDH-ES+A128KW

ECDH-ES+A192KW

ECDH-ES+A256KW

YES

spomky-labs/aes-key-wrap is required for *KW algorithms. See the supported curves

ECDH-SS

ECDH-SS+A128KW

ECDH-SS+A192KW

ECDH-SS+A256KW

YES

spomky-labs/aes-key-wrap is required for *KW algorithms. See the supported curves

A128KW

A192KW

A256KW

YES

spomky-labs/aes-key-wrap is required

PBES2-HS256+A128KW

PBES2-HS384+A192KW

PBES2-HS512+A256KW

YES

spomky-labs/aes-key-wrap is required

A128GCMKW

A192GCMKW

A256GCMKW

YES

spomky-labs/aes-key-wrap is required

ECDH-ES with X25519 curve

YES

SODIUM extension is required

ECDH-ES with X448 curve

NO

No extension or built-in implementation available

Other key encryption algorithms like RSA-OAEP-384, RSA-OAEP-512, and chacha20-poly1305 are also available in the Jose\Experimental namespace. These algorithms should be used for testing purposes only or for compatibility with old systems.

Supported Content Encryption Algorithms

Content Encryption Algorithm
Supported

A128CBC-HS256

A192CBC-HS384

A256CBC-HS512

YES

A128GCM

A192GCM

A256GCM

YES

Other content encryption algorithms like A128CTR, A192CTR, A256CTR, and various AES-CCM algorithms (e.g., A128CCM-16-128, A256CCM-64-64) are also available in the Jose\Experimental namespace. These algorithms should be used for testing purposes only or for compatibility with old systems.

Last updated

Was this helpful?