Relative Content

Tag Archive for deno

How do I get a CryptoKey from a public key to verify a SHA256 signature?

To verify a rewarded ad, google sends a signature to be verified using a key available at https://gstatic.com/admob/reward/verifier-keys.json.
Unfortunately I don’t know how to use crypto.subtle.verify (which I assume is the correct function for this) to verify the signature against the content. It seems I need an instance of CryptoKey but I don’t know how to get it. I’ve tried using importKey but I cannot get it to parse the key correctly because I don’t know which algorithm to use (Google’s documentation just says SHA256 but deno needs more it seems).