Class

KeyStore

KeyStore~KeyStore(password)

Class representing a Findora keystore. At the core of a Findora keystore is an encrypted seed with which users can deterministically generate ledger keypairs. The keystore seed is encrypted by a master key derived from a user-provided password.

Constructor

# new KeyStore(password)

Creates a new keystore with an underlying seed encrypted by the provided password.

Parameters:
Name Type Description
password string

Password used to derive the master key that keystore seed will be encrypted under.

View Source keystore.js, line 31

Methods

# static deserialize() → {KeyStore}

Deserializes a serialized keystore.

View Source keystore.js, line 123

KeyStore

# static fromSeed() → {KeyStore}

Generates a KeyStore from an existing seed.

View Source keystore.js, line 137

KeyStore

# addPublicKey(masterKey, name)

Adds a ledger public key to the keystore.

Parameters:
Name Type Description
masterKey string

Derived key that the keystore seed is decrypted under.

name string

Name of the key.

See:
  • genMasterKey for information about how generate the master key.

View Source keystore.js, line 74

# genKeyPair(masterKey, name) → {XfrKeyPair}

Deterministically generates a ledger keypair from the keystore seed and the provided name.

Parameters:
Name Type Description
masterKey string

Derived key that the keystore seed is decrypted under.

name string

Name of the key.

See:
  • genMasterKey for information about how generate the master key.

View Source keystore.js, line 63

XfrKeyPair

# genMasterKey(password)

Generates the keystore's master key. The master key decrypts the encrypted seed that is used to deterministically generate ledger keypairs.

Parameters:
Name Type Description
password string

Password that the keystore seed is decrypted under.

View Source keystore.js, line 52

# getPublicKey() → {String|undefined}

Returns a base64-encoded public key, or undefined if a keypair with the given named isn't currently cached in the keystore.

See:
  • addPublicKey for information about how to add a public key to the keystore.

View Source keystore.js, line 88

String | undefined

# getPublicKeys() → {Array}

Returns a list of base64-encoded public key and name pairs (e.g. [["Alice", "g0Kge-wOwr_2CF0yVNkxKPVFVfR5kvo3HpGu0lG3utk="], ["Bob", "yeg4zFQLLs-XRktnYRIkINzeJaJeLsMrf_GpuRFEFE8="]]).

View Source keystore.js, line 97

Array

# getSeed() → {String}

Decrypt and return the underlying keystore seed. Use with caution, as access to the keystore seed renders the keystore compleetly insecure.

See:
  • genMasterKey for information about how generate the master key.

View Source keystore.js, line 106

String

# serialize() → {String}

Serialize the keystore as a string.

View Source keystore.js, line 114

String