phalcon/cphalcon · error · UnsupportedHmacAlgorithm

Unsupported HMAC algorithm

Error message

Unsupported HMAC algorithm

What it means

Error "Unsupported HMAC algorithm" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Encryption/Security/JWT/Signer/Hmac.zep:42

    /**
     * Hmac constructor.
     *
     * @param string $algo
     *
     * @throws UnsupportedAlgorithmException
     */
    public function __construct( string algo = "sha512")
    {
        array supported;

        let supported = [
            "sha512" : 1,
            "sha384" : 1,
            "sha256" : 1
        ];

        if !isset supported[algo] {
            throw new UnsupportedHmacAlgorithm();
        }

        let this->algorithm = algo;
    }

    /**
     * Return the value that is used for the "alg" header
     *
     * @return string
     */
    public function getAlgHeader() -> string
    {
        return "HS" . str_replace("sha", "", this->algorithm);
    }

    /**
     * Sign a payload using the passphrase
     *

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Encryption/Security/JWT/Signer/Hmac.zep:42 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/e0e93adc2ad01719. Report an issue: GitHub.