Skip to content

Support loading ML-DSA keys from Java keystores - #55395

Draft
stianst wants to merge 1 commit into
keycloak:mainfrom
stianst:ml-dsa-java-keystore
Draft

stianst wants to merge 1 commit into
keycloak:mainfrom
stianst:ml-dsa-java-keystore

Conversation

@stianst

@stianst stianst commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

One tricky aspect is OpenJDK generates ML-DSA keys where the algorithm is set to ML-DSA and not the specific algorithm (i.e. ML-DSA-44). These keys can not be used by BouncyCastle. To prevent this being an issue keys are always loaded with BouncyCastle when possible, and converted otherwise.

This also includes some minor updates to GeneratedMlDsaKeyProvider to make sure it uses BouncyCastle to generate keys.

Closes #50679

Signed-off-by: stianst stianst@gmail.com

@stianst
stianst force-pushed the ml-dsa-java-keystore branch 4 times, most recently from 3a42ea0 to 8a9b380 Compare November 20, 2026 11:09
@stianst
stianst marked this pull request as ready for review November 20, 2026 12:30
@stianst
stianst requested a review from a team as a code owner November 20, 2026 12:30
Copilot AI balanced review requested due to automatic review settings November 20, 2026 12:30

This comment was marked as outdated.

@stianst
stianst force-pushed the ml-dsa-java-keystore branch from 8a9b380 to df8e43f Compare November 23, 2026 07:57
Copilot AI balanced review requested due to automatic review settings November 23, 2026 07:57

This comment was marked as outdated.

@stianst
stianst marked this pull request as draft November 23, 2026 08:06
@stianst
stianst force-pushed the ml-dsa-java-keystore branch 5 times, most recently from 83132c5 to 1f78d41 Compare November 23, 2026 12:27
@stianst
stianst requested a balanced review from Copilot November 23, 2026 12:27

This comment was marked as outdated.

This comment was marked as outdated.

@stianst
stianst force-pushed the ml-dsa-java-keystore branch from ae50121 to c1ad812 Compare November 23, 2026 15:08
One tricky aspect is OpenJDK generates ML-DSA keys where the algorithm is set to ML-DSA and not the specific algorithm (i.e. ML-DSA-44). These keys can not be used by BouncyCastle. To prevent this being an issue keys are always loaded with BouncyCastle when possible, and converted otherwise.

This also includes some minor updates to GeneratedMlDsaKeyProvider to make sure it uses BouncyCastle to generate keys.

Closes keycloak#50679

Signed-off-by: stianst <stianst@gmail.com>

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.

🔵 Needs a closer look

Cross-provider ML-DSA conversion and certificate-chain validation need BouncyCastle integration verification across JDK versions and keystore formats, since the standalone check could not validate pre-JDK-24 loading.

No open issues 🎉

1 resolved since last review

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.

Support loading ML-DSA keys from Java keystores

2 participants