arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Signature Algorithms

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

  • HMAC with SHA-2 Functions. Package web-token/jwt-signature-algorithm-hmac

    • HS256

    • HS384

    • HS512

  • Elliptic Curve Digital Signature Algorithm (ECDSA). Package web-token/jwt-signature-algorithm-ecdsa

    • ES256

    • ES384

  • RSASSA-PKCS1 v1_5. Package web-token/jwt-signature-algorithm-rsa

    • RS256

    • RS384

  • RSASSA-PSS. Package web-token/jwt-signature-algorithm-rsa

    • PS256

    • PS384

  • Edwards-curve Digital Signature Algorithm (EdDSA) Package web-token/jwt-signature-algorithm-eddsa

    • EdDSA (only with the Ed25519 curve)

  • Unsecured algorithm Package web-token/jwt-signature-algorithm-none

    • none

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 all part of the package web-token/jwt-signature-algorithm-experimental

  • RS1: RSASSA-PKCS1 v1_5 with SHA-1 hashing function.

  • HS1: HMAC with SHA-1 hashing function.

  • ES256K

hashtag
How To Use

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

Example:

  • ES512

  • RS512

  • PS512

  • : Elliptic curve secp256k1 support (v2.1+).
    Algorithm Manager
    <?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(),
    ]);