Download Java KeyStore for one alias?

Does anyone know if KeyStore can be downloaded to request a password for a given alias?

Example:

In my keystore, I have two secret keys: Alice's encryption certificate and Bob's encryption certificate.

When I load my key store:

keyStore = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
keyStore.load(null);

They tell me how to store keys for Alice and Bob. Once they are entered, I can use getKey("Alice Encryption Certificate", null);to extract Alice's secret key. My keys are protected by Entrust Security Provider, it is he who asks me for passwords when loading the keystore. If I don’t enter Bob’s password and try to get his key, he will return zero, this is normal, but I would like to avoid the password prompt.

Is it possible to somehow indicate that I only want Alice’s key before loading the keystore, so I never asked for Bob’s password?

Thank.

+5
source share
1 answer

We had the same problem, and we could not find a way to do this. Basically, you ask if there is a way to partially load the keystore. This complicates the situation when the MSCAPI provider ignores any password that you provide.

We deal with the problem by storing only one key with the MSCAPI keystore. Turns out this works better with the Smartcard security model.

+3
source

All Articles