Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KeyPair

Hierarchy

Constructors

constructor

  • Parameters

    • secretKey: Buffer
    • type: KeyType = ...

    Returns KeyPair

Properties

Readonly _keyType

_keyType: KeyType

Readonly _secretKey

_secretKey: Buffer

Accessors

address

  • Returns Address

Abstract publicKey

  • Returns PublicKey

type

  • Returns KeyType

Methods

Abstract sign

  • Parameters

    • message: Buffer

      Sha256 hash of message

    Returns Signature

toString

  • toString(): string
  • Returns string

Abstract verify

  • verify(message: Buffer, signature: Buffer[]): boolean
  • Parameters

    • message: Buffer

      Buffer Sha256 hash of message

    • signature: Buffer[]

      Buffer[]

    Returns boolean

Static fromRandom

  • fromRandom(curve?: string): KeyPair
  • Parameters

    • curve: string = ...

      Name of elliptical curve, case-insensitive

    Returns KeyPair

    Random KeyPair based on the curve

Static fromString

  • fromString(secretKey: string): KeyPair
  • Construct an instance of key pair given a secret key. It's generally assumed that these are encoded in base58check.

    Parameters

    • secretKey: string

    Returns KeyPair

Generated using TypeDoc