Skip to content

Conversion between Algorithm and KeyAlgorithm #513

Description

@BatmanAoD

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions