Subject: [Acme] [ACME][QUESTION] Mac Based Algorithm Verfication

From: Praveen Sharma <[email-masked]>
Date: Fri, 8 Dec 2017 13:44:14 +0530

Hi Devs,

How to verify that the provided algorithm is MAC based algorithm using any
node module?

Thanks
-- 
*Praveen Sharma* | Enterprise Software Engineer
HotWax Systems <https://www.hotwaxsystems.com
<https://mailtrack.io/trace/link/dee682ea4684967d96c9b4da4a1b5c1fed7725cc?url=https%3A%2F%2Fwww.hotwaxsystems.com&userId=2267679&signature=60902dc17dcf82f3>
Cell phone: 8878488144

‌

---

From: Ilari Liusvaara <[email-masked]>
Date: Fri, 8 Dec 2017 10:45:45 +0200

> How to verify that the provided algorithm is MAC based algorithm using any

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