Skip to content

Refine OID4VP JWS Signature Handling and Repair Unit Test Suite#74

Merged
Awambeng merged 3 commits into
mainfrom
fix/oid4vp-signatures-and-test-stability
May 18, 2026
Merged

Refine OID4VP JWS Signature Handling and Repair Unit Test Suite#74
Awambeng merged 3 commits into
mainfrom
fix/oid4vp-signatures-and-test-stability

Conversation

@Awambeng

@Awambeng Awambeng commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Problem

The plugin was throwing Invalid JWS signature errors, and the test suite had several regressions. Specifically:

  • Signature format handling: ECDSA signatures needed to be properly converted from DER format to concatenated R|S format for JWS compatibility.
  • Key fallback support: Tests failed in environments where only RSA keys were available, even though OID4VP prefers ES256.
  • Brittle mocking infrastructure: The mock setup was missing SignatureProvider stubs, causing failures during JWT generation.

Solution

  • Implemented prioritized signing fallback logic (ES256RS256) in CryptoIdentityService.
  • Improved realm context initialization to ensure proper cryptographic provider resolution.
  • Refactored MockKeycloakTest to provide a complete mock environment for JWS signing.
  • Generated mathematically valid P-256 test resources to prevent common Java KeyFactory exceptions.

Related to ADORSYS-GIS/keycloak-oid4vp-plugin#31

…back to RS256 and improve realm context initialization

Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>

@forkimenjeckayang forkimenjeckayang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

few comments @Awambeng

Comment thread src/main/java/com/adorsys/keycloakstatuslist/service/CryptoIdentityService.java Outdated
Comment thread src/main/java/com/adorsys/keycloakstatuslist/service/CryptoIdentityService.java Outdated
Comment thread src/main/java/com/adorsys/keycloakstatuslist/service/CryptoIdentityService.java Outdated
Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
@Awambeng

Copy link
Copy Markdown
Collaborator Author

@forkimenjeckayang I’ve addressed the comments. Please take another look when you get the chance.

@mbunwe-victor mbunwe-victor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hello @Awambeng, could you check my comments?

Comment thread src/test/java/com/adorsys/keycloakstatuslist/helpers/MockKeycloakTest.java Outdated
Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
@Awambeng Awambeng requested a review from mbunwe-victor May 18, 2026 08:50

@forkimenjeckayang forkimenjeckayang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

My concerns have been addressed. LGTM

@mbunwe-victor mbunwe-victor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for considering my comments, @Awambeng. All comments resolved, and it LGTM.

@IngridPuppet IngridPuppet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Awambeng Awambeng merged commit 6781300 into main May 18, 2026
1 check passed
@Awambeng Awambeng deleted the fix/oid4vp-signatures-and-test-stability branch May 18, 2026 15:26
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.

4 participants