Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EthereumKeyStore

Decrypt private key from key store data Supports key store versions: v1, v3, v4

Example of usage (Node env):

const keyStoreFilePath = path.join(process.cwd(), 'validator_keys', 'keystore.json'); const keyStoreString: string = fs.readFileSync(keyStoreFilePath).toString(); const keyStoreData = JSON.parse(keyStoreString); const keyStore = new EthereumKeyStore(keyStoreData); const password = 'testtest'; console.log('Private Key:', await keyStore.getPrivateKey(password));

Hierarchy

  • EthereumKeyStore

Index

Constructors

Properties

keyStoreData: any
privateKey: string = ''
wallet: undefined | default

Methods

  • fromV4(input: string | V4Keystore, password: string): Promise<default>
  • Import a wallet (Version 4 of the Ethereum wallet format).

    Parameters

    • input: string | V4Keystore

      A JSON serialized string, or an object representing V3 Keystore.

    • password: string

      The keystore password.

    Returns Promise<default>

  • getPrivateKey(password?: string): Promise<string>
  • getPublicKey(): string
  • runCipherBuffer(cipher: Cipher | Decipher, data: Buffer): Buffer
  • toHexString(byteArray: Uint8Array): string

Generated using TypeDoc