com.r3corda.node.services.keys / PersistentKeyManagementService

# PersistentKeyManagementService

`class PersistentKeyManagementService : SingletonSerializeAsToken, KeyManagementService`

A persistent re-implementation of E2ETestKeyManagementService to support node re-start.

This is not the long-term implementation. See the list of items in the above class.

This class needs database transactions to be in-flight during method calls and init.

### Constructors

<init> | `PersistentKeyManagementService(initialKeys: Set<KeyPair>)` A persistent re-implementation of E2ETestKeyManagementService to support node re-start.

### Properties

keys | `val keys: Map<PublicKey, PrivateKey>` Returns a snapshot of the current pubkey->privkey mapping.

### Functions

freshKey | `fun freshKey(): KeyPair` Generates a new random key and adds it to the exposed map.

### Inherited Functions

toKeyPair | `open fun toKeyPair(publicKey: PublicKey): KeyPair`
toPrivate | `open fun toPrivate(publicKey: PublicKey): PrivateKey`
toToken | `open fun toToken(context: SerializeAsTokenContext): SerializationToken`