Skip to content

feat(jwt): support RSA-PSS signatures (PS256/PS384/PS512)#336

Merged
EdSchouten merged 2 commits into
buildbarn:mainfrom
chagui:chagui/jwt/rsa-pss-support
May 7, 2026
Merged

feat(jwt): support RSA-PSS signatures (PS256/PS384/PS512)#336
EdSchouten merged 2 commits into
buildbarn:mainfrom
chagui:chagui/jwt/rsa-pss-support

Conversation

@chagui
Copy link
Copy Markdown
Contributor

@chagui chagui commented May 7, 2026

This PR adds RSA-PSS (PS256/PS384/PS512) verification to the JWT validator, alongside the existing PKCS#1 v1.5 (RS256/RS384/RS512) support.
We want to support an internal identity provider that signs tokens with PSS.

Copy link
Copy Markdown
Member

@EdSchouten EdSchouten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking: RS* and PS* always use the same JSON Web Keys? No distinct formats between the two? If so, then it's fine to keep this all implemented by a single type.

Comment thread pkg/jwt/rsa_sha_signature_validator.go
@chagui
Copy link
Copy Markdown
Contributor Author

chagui commented May 7, 2026

Just checking: RS* and PS* always use the same JSON Web Keys? No distinct formats between the two? If so, then it's fine to keep this all implemented by a single type.

That's my understanding, asked an LLM to be sure:

RFC 7518 §6.3 defines a single RSA JWK shape (kty=RSA, params n/e) with no distinction between RS* and PS*; padding is selected by the JWS header alg. go-jose decodes both into *rsa.PublicKey, so a single validator type is the right fit.

Pushed the alphabetical sort as new commit, feel free to squash-merge

@EdSchouten EdSchouten merged commit e5d91ca into buildbarn:main May 7, 2026
3 checks passed
@chagui chagui deleted the chagui/jwt/rsa-pss-support branch May 7, 2026 13:25
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.

2 participants