Skip to content

Generate ES256 verifier key ready for HAIP rules#51200

Merged
rmartinc merged 1 commit into
keycloak:mainfrom
rmartinc:issue-51191
Jul 27, 2026
Merged

Generate ES256 verifier key ready for HAIP rules#51200
rmartinc merged 1 commit into
keycloak:mainfrom
rmartinc:issue-51191

Conversation

@rmartinc

@rmartinc rmartinc commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Closes #51191

The verifier key for the oid4vp tests follow HAIP rules enforced by #51176. Similar to what oid4vci is doing.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates OID4VP tests to use an ES256 signing key with a CA-issued certificate, satisfying HAIP requirements.

Changes:

  • Generates P-256 CA and leaf key pairs.
  • Configures the verifier key provider with the non-self-signed leaf certificate and keys.

Closes keycloak#51191

Signed-off-by: rmartinc <rmartinc@redhat.com>
Copilot AI review requested due to automatic review settings July 27, 2026 14:10
@rmartinc

Copy link
Copy Markdown
Contributor Author

Added some constants instead direct strings. Nothing important changed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@mabartos mabartos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just one comment for a follow-up.

GeneratedEcdsaKeyProviderFactory.ECDSA_PUBLIC_KEY_KEY, List.of(
Base64.getEncoder().encodeToString(leafKeyPair.getPublic().getEncoded())),
GeneratedEcdsaKeyProviderFactory.ECDSA_ELLIPTIC_CURVE_KEY, List.of("P-256"),
Attributes.EC_GENERATE_CERTIFICATE_KEY, List.of("true"))));

@mabartos mabartos Jul 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So, the EC_GENERATE_CERTIFICATE_KEY is not sufficient here, right? Is it worth extending it to comply with the HAIP compliance?

EDIT: Not a blocker, just for the follow-up consideration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, not sufficient for HAIP. The generate certificate attribute creates a self-signed one, this is what it was done before but after #51176 we need to have a CA+leaf configuration in the key.

In real configurations (for example conformance tests), the provider used is not the common generated EC (which is intended for self-signed always). Normally a Java Keystore is used where you do a normal request, obtain a cert signed by a CA and so on and so forth. But for tests I'm just doing this trick which is the same we are using for vci.

I think that it's enough for testing.

@rmartinc
rmartinc merged commit fa440ad into keycloak:main Jul 27, 2026
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OID4VPVerifierTestBase failure in CI

5 participants