Comparison

util/jwt.lua @ 12736:ad4ab01f9b11

util.jwt: Add support for ES512 (+ tests)
author Matthew Wild <mwild1@gmail.com>
date Thu, 29 Sep 2022 23:17:42 +0100
parent 12735:445f7bd6ffc4
child 12738:62100f31eb8a
comparison
equal deleted inserted replaced
12735:445f7bd6ffc4 12736:ad4ab01f9b11
148 end 148 end
149 149
150 local algorithms = { 150 local algorithms = {
151 HS256 = new_hmac_algorithm("HS256"), HS384 = new_hmac_algorithm("HS384"), HS512 = new_hmac_algorithm("HS512"); 151 HS256 = new_hmac_algorithm("HS256"), HS384 = new_hmac_algorithm("HS384"), HS512 = new_hmac_algorithm("HS512");
152 ES256 = new_ecdsa_algorithm("ES256", crypto.ecdsa_sha256_sign, crypto.ecdsa_sha256_verify, 32); 152 ES256 = new_ecdsa_algorithm("ES256", crypto.ecdsa_sha256_sign, crypto.ecdsa_sha256_verify, 32);
153 ES512 = new_ecdsa_algorithm("ES512", crypto.ecdsa_sha512_sign, crypto.ecdsa_sha512_verify, 66);
153 RS256 = new_rsa_algorithm("RS256"), RS384 = new_rsa_algorithm("RS384"), RS512 = new_rsa_algorithm("RS512"); 154 RS256 = new_rsa_algorithm("RS256"), RS384 = new_rsa_algorithm("RS384"), RS512 = new_rsa_algorithm("RS512");
154 PS256 = new_rsa_algorithm("PS256"), PS384 = new_rsa_algorithm("PS384"), PS512 = new_rsa_algorithm("PS512"); 155 PS256 = new_rsa_algorithm("PS256"), PS384 = new_rsa_algorithm("PS384"), PS512 = new_rsa_algorithm("PS512");
155 }; 156 };
156 157
157 local function new_signer(algorithm, key_input, options) 158 local function new_signer(algorithm, key_input, options)