Diff

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
line wrap: on
line diff
--- a/util/jwt.lua	Thu Sep 29 23:15:39 2022 +0100
+++ b/util/jwt.lua	Thu Sep 29 23:17:42 2022 +0100
@@ -150,6 +150,7 @@
 local algorithms = {
 	HS256 = new_hmac_algorithm("HS256"), HS384 = new_hmac_algorithm("HS384"), HS512 = new_hmac_algorithm("HS512");
 	ES256 = new_ecdsa_algorithm("ES256", crypto.ecdsa_sha256_sign, crypto.ecdsa_sha256_verify, 32);
+	ES512 = new_ecdsa_algorithm("ES512", crypto.ecdsa_sha512_sign, crypto.ecdsa_sha512_verify, 66);
 	RS256 = new_rsa_algorithm("RS256"), RS384 = new_rsa_algorithm("RS384"), RS512 = new_rsa_algorithm("RS512");
 	PS256 = new_rsa_algorithm("PS256"), PS384 = new_rsa_algorithm("PS384"), PS512 = new_rsa_algorithm("PS512");
 };