JWT Framework
v4.0
v4.0
  • Introduction
  • Introduction
    • Provided Features
    • Security Recommendations
    • The Framework
    • Pre-requisite
    • Contributing
  • The Components
    • Algorithm Management (JWA)
    • Key (JWK) and Key Set (JWKSet)
      • Key (JWK)
      • Key Set (JWKSet)
    • Header Checker
    • Claim Checker
    • Signed Tokens (JWS)
      • Signature Algorithms
      • JWS Creation
      • JWS Loading
    • Encrypted Tokens (JWE)
      • Encryption Algorithms
      • JWE Creation
      • JWE Loading
  • The Symfony Bundle
    • Symfony Bundle
    • Algorithm Management
    • Key and Key Set Management
      • Key Management (JWK)
      • Key Set Management (JWKSet)
    • Header and Claim Checker Management
    • Signed Tokens
      • JWS serializers
      • JWS creation
      • JWS verification
    • Encrypted Tokens
      • JWE serializers
      • JWE creation
      • JWE decryption
    • Configuration Helper
    • Events
  • Console Command
    • Console
    • Standalone Application
    • PHAR Application
    • Symfony Console
  • Advanced Topics
    • Nested Tokens
    • Serialization
    • Custom Algorithm
    • Signed tokens and
      • Unprotected Header
      • Multiple Signatures
      • Detached Payload
      • Unencoded Payload
    • Encrypted tokens and
      • Unprotected Headers
      • Multiple Recipients
      • Additional Authentication Data (AAD)
  • Benchmark
    • How To
    • Result table
  • Migration
    • From v1.x to v2.0
    • From v2.x to v3.0
    • From v3.x to v4.0
Powered by GitBook
On this page
  • Experimental Algorithms
  • How To Use

Was this helpful?

Export as PDF
  1. The Components
  2. Signed Tokens (JWS)

Signature Algorithms

PreviousSigned Tokens (JWS)NextJWS Creation

Last updated 10 months ago

Was this helpful?

This framework comes with several signature algorithms. These algorithms are in the following namespace: Jose\Component\Signature\Algorithm.

Algorithm
Description

HS256

HS384

HS512

HMAC with SHA-2 Functions

ES256

ES384

ES512

Elliptic Curve Digital Signature Algorithm (ECDSA)

RS256

RS384

RS512

RSASSA-PKCS1 v1_5

PS256

PS384

PS512

RSASSA-PSS

EdDSA (only with the Ed25519 curve)

Edwards-curve Digital Signature Algorithm (EdDSA)

none

Not a secure algorithm. Please use with caution

Experimental Algorithms

The following signature algorithms are experimental and must not be used in production unless you know what you are doing. They are proposed for testing purpose only.

They are provided throught the package web-token/jwt-experimental.

Algorithm
Description

RS1

RSASSA-PKCS1 v1_5 with SHA-1 hashing function

HS1

HMAC with SHA-1 hashing function

ES256K

Elliptic curve secp256k1 support

How To Use

These algorithms have to be used with the . They do not need any arguments.

Example:

<?php

use Jose\Component\Core\AlgorithmManager;
use Jose\Component\Signature\Algorithm\PS256;
use Jose\Component\Signature\Algorithm\ES512;
use Jose\Component\Signature\Algorithm\None;

$algorithm_manager = new AlgorithmManager([
    new PS256(),
    new ES512(),
    new None(),
]);
Algorithm Manager