Key Stores

For managing Java key stores, I suggest using KeyStore Explorer.

Default

KeyStore keystore();

Returns the default key store using configuration from the following system properties:

  • javax.net.ssl.keyStore

  • javax.net.ssl.keyStorePassword

The key store location supports the following protocols:

  • classpath:

  • http:

  • https:

  • file:

    If no protocol is specified, file is assumed. The default key store type is PKCS12.

Usage Example

KeyStore keystore = keystore();

Default with Type

Same as above but the key store type can be specified. For instance, valid types include: JKS, PKCS12.

Usage Example

From Location

Loads a key store from the given location.

The location parameter supports the protocols described in the default key store api method.

The key store is opened with the given password.

The key store type is assumed to be the default: PKCS12.

Usage Example

From Location with Type

Same as in from location but allows you to specify a key store type. For instance, valid types include: JKS, PKCS12.

Usage Examples

Last updated

Was this helpful?