What algorithm does java.security.KeyStore use to encrypt privateKey in KeyStore.setKeyEntry () and KeyStore.store ()?

setKeyEntry () allows the password to protect one private key and store () allows you to encrypt the password for the entire keyStore. I am using the keystore type pkcs12 with BC as a provider, and I cannot figure out what it uses for encryption.

Can I specify the type of encryption used in these methods?

+4
source share
2 answers

The implementation of KeyStore depends on the type you are requesting, and for some types it also depends on the provider.

If you are talking about the "JKS" type, you can find a description of the format and algorithms used here.

In the JKS keystore, you cannot specify an encryption algorithm for private keys.

+2
source

It depends on which KeyStore provider you are using.

The JCEKS provider uses the password-based encryption algorithm PBEWithMD5AndTripleDES.

+2
source

All Articles