[jose](https://github.com/latchset/jose) is a C implementation of JWS and JWK (among others). It’s already packaged by major distros, as you can see on [repology](https://repology.org/project/jose/versions).