Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(es256k): added optional feature to invert signature #13

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

beatt83
Copy link
Owner

@beatt83 beatt83 commented Apr 22, 2024

Since most of other jwt libraries in other languages have the R and S bytes reversed.

This has 2 optional features:
First you can enable inverted RS signature from ES256KSigner.invertedBytesR_S = true, this will reverse R bytes, reverse S bytes and concatenate both, this will enable the signatures to be verified by other libraries

Second you can enable ES256KVerifier.bouncyCastleFailSafe = true this will failsafe to reversing the bytes if the first verification fails. Providing verification for both case scenarios.

@beatt83 beatt83 force-pushed the feature/bouncy_castle_failsafe branch from ecdefcc to 63c4577 Compare April 22, 2024 16:23
Since most of other jwt libraries in other languages have the R and S bytes reversed.

This has 2 optional features:
First you can enable inverted RS signature from ES256KSigner.invertedBytesR_S = true, this will reverse R bytes, reverse S bytes and concatenate both, this will enable the signatures to be verified by other libraries

Second you can enable ES256KVerifier.bouncyCastleFailSafe = true this will failsafe to reversing the bytes if the first verification fails. Providing verification for both case scenarios.
@beatt83 beatt83 force-pushed the feature/bouncy_castle_failsafe branch from 63c4577 to f65aa6c Compare April 22, 2024 16:24
@beatt83 beatt83 changed the title feat(es256k): added optional feature to invert signature since most of other jwt libraries in other languages have the R and S reversed feat(es256k): added optional feature to invert signature Apr 22, 2024
@beatt83 beatt83 merged commit f4d3861 into main Apr 22, 2024
2 checks passed
@beatt83 beatt83 deleted the feature/bouncy_castle_failsafe branch April 22, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant