Skip to content

Conversation

@dtivel
Copy link
Collaborator

@dtivel dtivel commented Mar 19, 2025

Resolve #827

#808 and #822 introduced a regression.

In Azure Key Vault:

  • a Key Vault has a unique URI of the form: <scheme>://<authority>
  • a certificate has a unique URI of the form: <scheme>://<authority>/certificates/<certificateId>
  • a private key has a unique URI of the form: <scheme>://<authority>/keys/<certificateId>

#808 and #822 added calls to CertificateClientBuilderExtensions.AddCertificateClient(...) and KeyClientBuilderExtensions.AddCryptographyClient(...). AddCertificateClient(...) has a vaultUri parameter which must be the Key Vault URI, while AddCryptographyClient(...) has a vaultUri parameter which must be the private key's URI. Documentation for the latter says, vaultUri should be "[t]he URI to a specific key in an Azure Key Vault, for example: https://my-vault.vault.azure.net/keys/my-key."

However, KeyVaultKeyIdentifier.VaultUri was passed to AddCryptographyClient(...), and that returns the Key Vault URI. The fix is to use the private key URI we already constructed ourselves.

@dtivel dtivel requested a review from a team as a code owner March 19, 2025 17:28
@dtivel dtivel merged commit 89dc76b into main Mar 19, 2025
3 checks passed
@dtivel dtivel deleted the dtivel/fix-azure-key-vault-signing branch March 19, 2025 17:51
dlemstra added a commit to dlemstra/sign that referenced this pull request Mar 20, 2025
dtivel pushed a commit that referenced this pull request Mar 20, 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.

Cannot sign file in 0.9.1-beta.25157.1

4 participants