Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to fetch Certificate (.jks file) stored in Secure Credentials Vault (SCV) using Java.

Deepti_JavaAug 17 2021

How to fetch Certificate (.jks file) stored in Secure Credentials Vault (SCV) using Java.
I had searched internet and found that we can get certificate like this for Keyvault:
KeyVaultClient keyVaultClient = new KeyVaultClient(credentials);
keyVaultClient.getCertificate(this.keyVaultUri, certificateName, '');

However, I don't know how to do this for Secure Credentials Vault (SCV).

  1. How to pass credentials to Vault Client?
  2. Do I have to use Secure Credentials Vault (SCV) credentials in the code?

KeyStore keyStore = KeyStore.getInstance("JKS");

//I have to get this .jks file from SCV

keyStore.load(new FileInputStream(".jks file"),
keyPassphrase.toCharArray());

SSLContext sslContext = SSLContexts.custom()
.loadKeyMaterial(keyStore, keyPassphrase.toCharArray())
.build();

HttpClient httpClient =
HttpClients.custom().setSSLContext(sslContext).build();

Comments
Post Details
Added on Aug 17 2021
0 comments
1,676 views