---
title: KeyStore
description: The configuration for a Java KeyStore, which stores cryptographic private keys and public key certificates.
component: pinggateway
version: 7.2
page_id: pinggateway:reference:KeyStore
canonical_url: https://docs.pingidentity.com/pinggateway/2025.11/reference/KeyStore.html
llms_txt: https://docs.pingidentity.com/pinggateway/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: 2025-06-02T16:30:54Z
superseded_by: https://docs.pingidentity.com/pinggateway/2025.11/reference/KeyStore.html
section_ids:
  KeyStore-usage: Usage
  KeyStore-properties: Properties
  KeyStore-example: Example
  KeyStore-moreinfo: More information
---

# KeyStore

The configuration for a Java [KeyStore](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/security/KeyStore.html), which stores cryptographic private keys and public key certificates.

## Usage

```json
{
  "name": name,
  "type": "KeyStore",
  "config": {
    "url": configuration expression<url>,
    "passwordSecretId": configuration expression<secret-id>,
    "type": configuration expression<string>,
    "secretsProvider": SecretsProvider reference,
    "password": string //deprecated
  }
}
```

## Properties

* `"url"`: *configuration expression<[url](preface.html#definition-url)>, required*

  URL to the keystore file.

  See also [Expressions](Expressions.html#Expressions).

* `"passwordSecretId"`: *configuration expression<[secret-id](preface.html#definition-secretid)>, optional*

  The secret ID of the password required to read private keys from the KeyStore.

  If the KeyStore is used as a truststore to store only public key certificates of peers and no password is required to do so, then you do not have to specify this field.

  Default: No password is set.

  See also [Expressions](Expressions.html#Expressions).

* `"type"`: *configuration expression<[string](preface.html#definition-string)>, optional*

  The secret store type.

* `"secretsProvider"`: *SecretsProvider [reference](preface.html#definition-reference), optional*

  The SecretsProvider to query for the keystore password. For more information, see [SecretsProvider](secrets.html#SecretsProvider).

  Default: The route's default secret service. For more information, see [Default secrets object](secrets.html#default-secrets-object).

* `"password"`: *string, optional*

  |   |                                                                                                                                                                       |
  | - | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  |   | The use of this property is deprecated; use `passwordSecretId` instead. For more information, refer to [Deprecation](../release-notes/deprecated-functionality.html). |

  The password to read private keys from the keystore.

  If the keystore is used as a truststore to store only public key certificates of peers and no password is required to do so, then you do not have to specify this field.

  Default: No password is set.

## Example

The following example configures a KeyStore that references the Java KeyStore file `$HOME/keystore.jks`. The KeyStore password is provided by a Java system property or environment variable, and retrieved by the SystemAndEnvSecretStore. By default, the password value must be base64-encoded.

```json
{
  "name": "MyKeyStore",
  "type": "KeyStore",
  "config": {
    "url": "file://${env['HOME']}/keystore.jks",
    "passwordSecretId": "keystore.secret.id",
    "secretsProvider": "SystemAndEnvSecretStore"
  }
}
```

## More information

[org.forgerock.openig.security.KeyStoreHeaplet](../_attachments/apidocs/org/forgerock/openig/security/KeyStoreHeaplet.html)

[JSSE Reference guide ](https://docs.oracle.com/en/java/javase/17/security/java-secure-socket-extension-jsse-reference-guide.html#GUID-93DEEE16-0B70-40E5-BBE7-55C3FD432345), [KeyManager](MiscellaneousConfigurationObjects.html#KeyManager), [TrustManager](MiscellaneousConfigurationObjects.html#TrustManager)
