Skip to content

Support EC in PEM/DER utils. - #38483

Merged
ahus1 merged 1 commit into
keycloak:mainfrom
Nordix:ec-pem-utils
Mar 27, 2025
Merged

Support EC in PEM/DER utils.#38483
ahus1 merged 1 commit into
keycloak:mainfrom
Nordix:ec-pem-utils

Conversation

@tsaarni

@tsaarni tsaarni commented Mar 27, 2025

Copy link
Copy Markdown
Contributor

This PR suggests small improvement to PEM/DER utilities:

  • Add support for decoding EC private keys.
  • Add support for decoding certificate bundles.
  • Add unit tests for the above.

Closes #38490

@tsaarni
tsaarni requested a review from a team as a code owner March 27, 2025 07:59
This change adds

- Support for decoding EC private keys.
- Support for decoding certificate bundles.

Signed-off-by: Tero Saarni <tero.saarni@est.tech>
@ahus1

ahus1 commented Mar 27, 2025

Copy link
Copy Markdown
Member

Thank you for this pull request. I see you linked it to the JGroups issue. Can please describe more about the scenario you are using it in, and what is now working what wasn't working before?

@tsaarni

tsaarni commented Mar 27, 2025

Copy link
Copy Markdown
Contributor Author

Hi @ahus1,

Currently nothing in upstream Keycloak requires this, but in the JGroups issue, you discuss a use case for EC.

In my case, I've used this in a Keycloak fork to support SASL EXTERNAL client certificate authentication for LDAP federation (related to #7365 and keycloak/keycloak-community#345). That code has been evolving in our repository since then, but I'd be very interested in upstreaming even a small parts like this of that work if accepted.

@ahus1

ahus1 commented Mar 27, 2025

Copy link
Copy Markdown
Member

@tsaarni - thank you for the explanation. I'd be happy to review and merge it, still it would need a separate enhancement issue where you link it to, probably copying your previous comment and describing when and where it is useful.

From the description above, it is IMHO not related to the JGroups issue.

I'll then review it probably next week.

@tsaarni

tsaarni commented Mar 27, 2025

Copy link
Copy Markdown
Contributor Author

Thank you @ahus1! I've now done that and fixed the issue reference in the description.

From the description above, it is IMHO not related to the JGroups issue.

My thought was that if support for EC is being implemented in #37786, this enhancement would be necessary, as the current utils cannot decode EC private keys.

@ahus1
ahus1 merged commit c7f0fc7 into keycloak:main Mar 27, 2025
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.

Support decoding EC private keys and PEM bundles in PEM/DER utilities

2 participants