add support for JWK
The branch for asymmetric keys https://github.com/typelevel/bobcats/pull/48 allows them to be given by two specifications:
- PKCS8KeySpec for private keys
- SPKIKeySpec for public keys
Both of those are usually sent around in a binary ASN.1 encoded form transformed in base64 as PEM documents. The binary encoding makes understanding what is wrong with them quite difficult as shown by bizarre problems such as in issue 1867 for the Signing HTTP Messages spec.
Luckily there are human readable JSON Web Key format that is supported by the Web Crypto API. This is widely used in new web based crypto protocols, and so should really be supported here too. One would then have to add something like the following
- JWKPublicKeySpec
- JWKPrivateKeySpec
It is helpful to keep this in mind as that should help in deciding about the public API for Signer and Verifier.
For Java this would I think require using an extra library such as "com.nimbusds" % "nimbus-jose-jwt" used in the demo test JWKCryptoSuite.scala.
If this dependency is problematic one should I guess make a separate project for it so that it can be pulled independently.