{"record":{"id":"e0e93adc2ad01719","repo":"phalcon/cphalcon","slug":"unsupported-hmac-algorithm","errorCode":null,"errorMessage":"Unsupported HMAC algorithm","messagePattern":"Unsupported HMAC algorithm","errorType":"exception","errorClass":"UnsupportedHmacAlgorithm","httpStatus":null,"severity":"error","filePath":"phalcon/Encryption/Security/JWT/Signer/Hmac.zep","lineNumber":42,"sourceCode":"    /**\n     * Hmac constructor.\n     *\n     * @param string $algo\n     *\n     * @throws UnsupportedAlgorithmException\n     */\n    public function __construct( string algo = \"sha512\")\n    {\n        array supported;\n\n        let supported = [\n            \"sha512\" : 1,\n            \"sha384\" : 1,\n            \"sha256\" : 1\n        ];\n\n        if !isset supported[algo] {\n            throw new UnsupportedHmacAlgorithm();\n        }\n\n        let this->algorithm = algo;\n    }\n\n    /**\n     * Return the value that is used for the \"alg\" header\n     *\n     * @return string\n     */\n    public function getAlgHeader() -> string\n    {\n        return \"HS\" . str_replace(\"sha\", \"\", this->algorithm);\n    }\n\n    /**\n     * Sign a payload using the passphrase\n     *","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Encryption/Security/JWT/Signer/Hmac.zep#L24-L60","documentation":"Error \"Unsupported HMAC algorithm\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Encryption/Security/JWT/Signer/Hmac.zep:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}