The Algorithm and KeyAlgorithm types seem closely related to me, since a JWK is used to verify a JWT, and the signing algorithm must match the verification algorithm. It seems that the crate is mostly built around Algorithm, but given a Jwk, I don't see a way to determine the supported Algorithm other than by manually converting jwk.common.key_algorithm (a KeyAlgorithm) into an Algorithm using an explicit match (and erroring on any of the variants that are not in Algorithm).
Is there a reason why the two types are separate, and why the crate itself does not provide conversions between them? If not, can impl TryInto<Algorithm> for KeyAlgorithm and Into<KeyAlgorithm> for Algorithm be added?
The
AlgorithmandKeyAlgorithmtypes seem closely related to me, since a JWK is used to verify a JWT, and the signing algorithm must match the verification algorithm. It seems that the crate is mostly built aroundAlgorithm, but given aJwk, I don't see a way to determine the supportedAlgorithmother than by manually convertingjwk.common.key_algorithm(aKeyAlgorithm) into anAlgorithmusing an explicitmatch(and erroring on any of the variants that are not inAlgorithm).Is there a reason why the two types are separate, and why the crate itself does not provide conversions between them? If not, can
impl TryInto<Algorithm> for KeyAlgorithmandInto<KeyAlgorithm> for Algorithmbe added?