Options
All
  • Public
  • Public/Protected
  • All
Menu

Class responsible for storage of private keys.

Hierarchy

  • PrivateKeyStorage

Index

Constructors

Methods

Constructors

constructor

  • Initializes a new instance of PrivateKeyStorage.

    Parameters

    • privateKeyExporter: IPrivateKeyExporter

      Object responsible for exporting private key bytes from IPrivateKey objects and importing private key bytes into IPrivateKey objects.

    • Default value keyEntryStorage: IKeyEntryStorage = new KeyEntryStorage()

      Object responsible for persistence of private keys data.

    Returns PrivateKeyStorage

Methods

delete

  • delete(name: string): Promise<void>
  • Removes the private key entry with the given name from persistent storage.

    Parameters

    • name: string

      Name of the private key to remove.

    Returns Promise<void>

load

  • Retrieves the private key with the given name from persistent storage. If private with the given name does not exist, resolves the returned Promise with null.

    Parameters

    • name: string

      Name of the private key to load.

    Returns Promise<IPrivateKeyEntry | null>

store

  • store(name: string, privateKey: IPrivateKey, meta?: undefined | object): Promise<void>
  • Persists the given privateKey and meta under the given name. If an entry with the same name already exists rejects the returned Promise with PrivateKeyExistsError error.

    Parameters

    • name: string

      Name of the private key.

    • privateKey: IPrivateKey

      The private key object.

    • Optional meta: undefined | object

    Returns Promise<void>