trying to prevent rooted devices to run my app.
What i want to do is to verify the signature of my signed attestation i got using safety net api on my app :
SafetyNet.getClient(context).attest(byteArrayNonce, "MYAPIKEY")
.addOnSuccessListener {
I have managed to verify the signature of the jwt received using google api calling:
https://www.googleapis.com/androidcheck/v1/attestations/verify?key=${safetyAPIKey}
(with signedAttestation in the request body)
Everything is fine and google tell me that verification succeeded, thing is that this service is only made for testing, i should be able to verify the signature on my server. From what i understand to verify the jwt signature i need a public key. I use https://www.npmjs.com/package/jws
I'm supposed to verify the signature like so :
jwt.verify(signedAttestation, key)
Thing is i have no idea where to find this key, it is clearly not the APIKey, there is some sample code provided by Google but it is in Java or C# and i'm clearly no capable of translating it into node js. It is available here: https://github.com/googlesamples/android-play-safetynet/ and i'm trying to focus on the offline verification : https://github.com/googlesamples/android-play-safetynet/blob/master/server/java/src/main/java/OfflineVerify.java Any help is welcome, thank you very much.