Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reload config for Keystore #1

Open
WinLordZ opened this issue Feb 17, 2023 · 0 comments
Open

How to reload config for Keystore #1

WinLordZ opened this issue Feb 17, 2023 · 0 comments

Comments

@WinLordZ
Copy link

WinLordZ commented Feb 17, 2023

I have 2 file config to load Keystore softhsm_1 and softhsm_2.
Value for file config changed, but Keystore and all alias not reload. But when I restarting JVM, value loaded with new config. How can i fix it? I've already load and instance keystore like this:

if (pkaSlot.equalsIgnoreCase("0")){
   pkcs11conf = "myPath\\softhsm_1.cfg"; //load config for slot 0
}else pkcs11conf = "myPath\\softhsm_2.cfg"

char[] password = "............".toCharArray();
provider = new sun.security.pkcs11.SunPKCS11(pkcs11conf);               
Security.addProvider(provider);

//Load keystore
keystore = KeyStore.getInstance("PKCS11");
fileInputStream = new FileInputStream(pkcs11conf);
keystore.load(fileInputStream, password);
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

No branches or pull requests

1 participant