The function authenticate()
decrypts a JSON webtoken using a public key.
Returns TRUE
if the request is granted to JAMES.
Examples
key <- openssl::rsa_keygen(bits = 2048)
pubkey <- as.list(key)$pubkey
claim <- jose::jwt_claim(data = list(applications = "james;srm;psycat"))
jwt <- jose::jwt_encode_sig(claim, key = key)
james:::authenticate(jwt, pubkey)