Skip to content

Server: Allow Azure Managed HSM to be used in the azurekeyvault key manager plugin#6751

Open
skeiffer wants to merge 3 commits intospiffe:mainfrom
skeiffer:dev/fixMhsmKty
Open

Server: Allow Azure Managed HSM to be used in the azurekeyvault key manager plugin#6751
skeiffer wants to merge 3 commits intospiffe:mainfrom
skeiffer:dev/fixMhsmKty

Conversation

@skeiffer
Copy link
Copy Markdown

Pull Request check list

  • Commit conforms to CONTRIBUTING.md?
  • Proper tests/regressions included?
  • Documentation updated?

Affected functionality
The azure keyvault key manager plugin does not work with Azure Managed HSM.

Description of change

  • Updated keyTypeFromKeySpec to allow RSA-HSM and EC-HSM as valid key types.
  • Updated keyVaultKeyToRawKey to normalize the kty, removing -HSM so data can be parsed by go-jose.
  • Created full unit tests for keyTypeFromKeySpec & keyVaultKeyToRawKey

Which issue this PR fixes
#6750

Scott Keiffer added 2 commits March 16, 2026 12:53
Signed-off-by: Scott Keiffer <[email protected]>
@skeiffer skeiffer changed the title Dev/fix mhsm kty Server: Allow Azure Managed HSM to be used in the azurekeyvault key manager plugin Mar 16, 2026
@MarcosDY MarcosDY requested a review from sorindumitru March 17, 2026 18:55
@nikotih
Copy link
Copy Markdown
Contributor

nikotih commented Mar 18, 2026

Hi @skeiffer since you are user of azurekeyvault plugin maybe have a look at
#6494
(bumps all azure libs)

in case you see any issues

@skeiffer
Copy link
Copy Markdown
Author

Hi @skeiffer since you are user of azurekeyvault plugin maybe have a look at #6494 (bumps all azure libs)

in case you see any issues

I can merge this into my branch and give it a test.

return nil, status.Error(codes.Internal, "key type is missing")
}
keyType := string(*keyVaultKey.Kty)
if strings.HasSuffix(keyType, "-HSM") {
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.

Changes look good based on what they document about the key type, but could explicitly check for RSA-HSM and EC-HSM in case they add anything else in there that might be causing us issues in the future?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry for the delay, I have made this change.

@skeiffer
Copy link
Copy Markdown
Author

skeiffer commented Mar 31, 2026

Hi @skeiffer since you are user of azurekeyvault plugin maybe have a look at #6494 (bumps all azure libs)
in case you see any issues

I can merge this into my branch and give it a test.

@nikotih, I tested these changes (after fixing the changed constant names) and it appeared to work as expected. I did not however test all the plugins that had their libraries updated.

I have not included your changes in this PR to keep things clean.

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.

3 participants