On Fri, Dec 08, 2017 at 01:44:14PM +0530, Praveen Sharma wrote:
> Hi Devs,
> 
> How to verify that the provided algorithm is MAC based algorithm using any
> node module?
> 

Don't know about Node modules (maybe whatever JOSE module you use has
such function?), but:

function is_signature_alg(alg)
{
        return /^[EPR]S(256|384|512)|EdDSA$/.test(alg);
}

function is_mac_alg(alg)
{
        return /^HS(256|384|512)$/.test(alg)
}


(Those two do direct regexps with known valid JOSE signature and MAC
algorithms).


-Ilari

_______________________________________________
Acme mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/acme

Reply via email to