I had stored a .pfx file in Azure Keyvault. I have the values of "Certificate Identifier", "Key Identifier" , "Secret Identifier". I want to use .pfx file in a java program. How could I fetch the file from Keyvault?
I had searched internet and found that we can get certificate using Keyvault
KeyVaultClient keyVaultClient = new KeyVaultClient(credentials);
keyVaultClient.getCertificate(this.keyVaultUri, certificateName, '');
1) How to pass credentials to KeyVaultClient?
2) Do I have to use Azure login credentials in the KeyVaultClient?
KeyStore keyStore = KeyStore.getInstance("JKS");
//I have to get this .pfx file from Azure Keyvault
keyStore.load(new FileInputStream(".pfx file"),
keyPassphrase.toCharArray());
SSLContext sslContext = SSLContexts.custom()
.loadKeyMaterial(keyStore, keyPassphrase.toCharArray())
.build();
HttpClient httpClient =
HttpClients.custom().setSSLContext(sslContext).build();