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:223

  #### Parameters

  - ##### key: Buffer

  #### Returns PrivateKey

## Properties

### Private key

key: Buffer

- Defined in crypto.ts:224

## Methods

### createPublic

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

- - Defined in crypto.ts:284

  Derive the public key for this private key.

  #### Parameters

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

  #### Returns PublicKey

### inspect

- inspect(): string

- - Defined in crypto.ts:299

  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:269

  Sign message.

  #### Parameters

  - ##### message: Buffer

    32-byte message.

  #### Returns Signature

### toString

- toString(): string

- - Defined in crypto.ts:291

  Return a WIF-encoded representation of the key.

  #### Returns string

### Static from

- from(value: string | Buffer): PrivateKey

- - Defined in crypto.ts:231

  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:256

  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:249

  Create a new instance from a seed.

  #### Parameters

  - ##### seed: string

  #### Returns PrivateKey

### Static fromString

- fromString(wif: string): PrivateKey

- - Defined in crypto.ts:242

  Create a new instance from a WIF-encoded key.

  #### Parameters

  - ##### wif: string

  #### Returns PrivateKey

Generated using TypeDoc