Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PrivateKey

ECDSA (secp256k1) private key.

Hierarchy

  • PrivateKey

Index

Constructors

constructor

  • Parameters

    • key: Buffer

    Returns PrivateKey

Properties

Private key

key: Buffer

Methods

createPublic

  • createPublic(prefix?: undefined | string): PublicKey
  • Derive the public key for this private key.

    Parameters

    • Optional prefix: undefined | string

    Returns PublicKey

getSharedSecret

  • getSharedSecret(publicKey: PublicKey): Buffer
  • Get shared secret for memo cryptography

    Parameters

    Returns Buffer

inspect

  • inspect(): string
  • Used by utils.inspect and console.log in node.js. Does not show the full key to get the full encoded key you need to explicitly call toString.

    Returns string

sign

  • Sign message.

    Parameters

    • message: Buffer

      32-byte message.

    Returns Signature

toString

  • toString(): string
  • Return a WIF-encoded representation of the key.

    Returns string

Static from

  • Convenience to create a new instance from WIF string or buffer.

    Parameters

    • value: string | Buffer

    Returns PrivateKey

Static fromLogin

  • Create key from username and password.

    Parameters

    • username: string
    • password: string
    • Default value role: KeyRole = "active"

    Returns PrivateKey

Static fromSeed

  • Create a new instance from a seed.

    Parameters

    • seed: string

    Returns PrivateKey

Static fromString

  • Create a new instance from a WIF-encoded key.

    Parameters

    • wif: string

    Returns PrivateKey

Generated using TypeDoc