ECDSA (secp256k1) private key.

### Hierarchy

- PrivateKey

## Index

### Constructors

- constructor

### Properties

- key

### Methods

- createPublic
- inspect
- sign
- toString
- from
- fromLogin
- fromSeed
- fromString

## Constructors

### constructor

- new PrivateKey(key: Buffer): PrivateKey

- - Defined in crypto.ts:229

  #### Parameters

  - ##### key: Buffer

  #### Returns PrivateKey

## Properties

### Private key

key: Buffer

- Defined in crypto.ts:231

## Methods

### createPublic

- createPublic(prefix?: undefined | string): PublicKey

- - Defined in crypto.ts:252

  Derive the public key for this private key.

  #### Parameters

  - ##### Optional prefix: undefined | string

  #### Returns PublicKey

### inspect

- inspect(): string

- - Defined in crypto.ts:267

  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: Buffer): Signature

- - Defined in crypto.ts:239

  Sign message.

  #### Parameters

  - ##### message: Buffer

    32-byte message.

  #### Returns Signature

### toString

- toString(): string

- - Defined in crypto.ts:259

  Return a WIF-encoded representation of the key.

  #### Returns string

### Static from

- from(value: string | Buffer): PrivateKey

- - Defined in crypto.ts:201

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

  #### Parameters

  - ##### value: string | Buffer

  #### Returns PrivateKey

### Static fromLogin

- fromLogin(username: string, password: string, role?: KeyRole): PrivateKey

- - Defined in crypto.ts:226

  Create key from username and password.

  #### Parameters

  - ##### username: string

  - ##### password: string

  - ##### Default value role: KeyRole = "active"

  #### Returns PrivateKey

### Static fromSeed

- fromSeed(seed: string): PrivateKey

- - Defined in crypto.ts:219

  Create a new instance from a seed.

  #### Parameters

  - ##### seed: string

  #### Returns PrivateKey

### Static fromString

- fromString(wif: string): PrivateKey

- - Defined in crypto.ts:212

  Create a new instance from a WIF-encoded key.

  #### Parameters

  - ##### wif: string

  #### Returns PrivateKey

Generated using TypeDoc