Skip to content

[OID4VCI] Also exclude non-self-signed trust anchors from the X5C chain of signed issuer metadata - #54930

Open
IngridPuppet wants to merge 2 commits into
keycloak:mainfrom
adorsys:54890-also-exclude-non-self-signed-ca-certs
Open

IngridPuppet wants to merge 2 commits into
keycloak:mainfrom
adorsys:54890-also-exclude-non-self-signed-ca-certs

Conversation

@IngridPuppet

@IngridPuppet IngridPuppet commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #54890

Main change in JavaKeystoreKeyProviderFactory to allow loading keystores whose chain does not terminate in a self-signed certificate, including a lone non-self-signed certificate. Admins could now omit certificates that should not be added to the metadata header. Rationale: It is hard to tell apart a standard intermediate certificate from one that is treated as a trust anchor.

@IngridPuppet
IngridPuppet requested a review from a team as a code owner November 9, 2026 15:34
Copilot AI balanced review requested due to automatic review settings November 9, 2026 15:34
…ed issuer metadata

Signed-off-by: Ingrid Kamga <Ingrid.Kamga@adorsys.com>
@IngridPuppet
IngridPuppet force-pushed the 54890-also-exclude-non-self-signed-ca-certs branch from 581e973 to 073c009 Compare November 9, 2026 15:36

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.

🟢 Approval recommended

No active review issues block the metadata certificate-filtering and keystore chain-handling changes.

No open issues 🎉

What changed in this PR

Addresses #54890 by excluding non-self-signed CA trust anchors from signed OID4VCI issuer metadata, improving wallet interoperability.

Changes:

  • Removes the topmost non-leaf certificate from metadata x5c headers when self-signed or marked CA.
  • Allows Java keystores with incomplete chains, including a single non-self-signed certificate.
  • Adds certificate-chain test scenarios and documents the differing metadata and SD-JWT VC behavior.
File Description
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​oid4vc/​OID4VCIssuerWellKnownProviderTest.java Tests metadata certificate filtering and signatures across four chain variants.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​oid4vc/​OID4VCIssuerTestBase.java Adds reusable signing-provider registration and cleanup helpers.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​oid4vc/​MdocTestSigningKey.java Generates keystores for four certificate-chain scenarios.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​keys/​JavaKeystoreKeyProviderTest.java Tests importing chains without self-signed roots.
test-framework/​core/​src/​main/​java/​org/​keycloak/​testframework/​crypto/​CryptoKeyStore.java Adds certificate-chain support to the keystore helper.
services/​src/​main/​java/​org/​keycloak/​protocol/​oid4vc/​issuance/​OID4VCIssuerWellKnownProvider.java Extends metadata trust-anchor filtering to non-self-signed CA certificates.
services/​src/​main/​java/​org/​keycloak/​keys/​JavaKeystoreKeyProviderFactory.java Validates chains excluding the anchor and accepts single certificates.
docs/​documentation/​server_admin/​topics/​oid4vci/​vc-issuer-configuration.adoc Clarifies keystore support and certificate-header filtering rules.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 9, 2026 15:37

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.

🟢 Approval recommended

No active review issues are recorded for the certificate-chain handling changes.

No open issues 🎉

Review effort: Balanced

@IngridPuppet

Copy link
Copy Markdown
Contributor Author

Working on review comments at https://oid4vc-sig.eudi-test.dev/reviews/54930.html...

Signed-off-by: Ingrid Kamga <Ingrid.Kamga@adorsys.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 13:15

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.

🟡 Changes recommended

The implementation retains a trailing non-self-signed CA certificate in x5c contrary to the stated requirement, so configured chains can still produce headers rejected by the referenced wallet.

1 open issue

Review effort: Balanced

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.

[OID4VCI] Also exclude non-self-signed trust anchors (marked CA:TRUE) from the X5C chain of signed issuer metadata

2 participants