[BUG] jarsigner + jca fails to sign when key vault happens to include "certificates" in the name #42162
Closed
3 tasks done
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
KeyVault
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Describe the bug
The key vault JCA library is unable to sign JARs using a certificate stored in an Azure Key Vault whose name contains the string "certificates". This is due to the library being unable to extract the correct certificate alias for certificates stored in the vault. The user facing result of this silent failure is the error
jarsigner error: java.lang.RuntimeException: unable to instantiate keystore class: AZUREKEYVAULT not found
Exception or Stack Trace
Full command and verbose output for an attempt to sign the jar "myjar.jar" with the certificate "mycert" stored in the vault "mycertificates":
To Reproduce
Attempt to sign a JAR using a certificate stored in an Azure vault with a name containing "certificates", e.g. "mycertificates":
Code Snippet
This line in
KeyVaultClient.java
:String alias = id.substring(id.indexOf("certificates") + "certificates".length() + 1);
For the string
https://mycertificates.vault.azure.net/certificates/mycert
results in the invalid aliasvault.azure.net/certificates/mycert
rather than the expectedmycert
Expected behavior
The key vault name should not have any impact on the ability to code sign using certificates stored in it.
Setup (please complete the following information):
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: