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

  #### Parameters

  - ##### key: Buffer

  #### Returns PrivateKey

## Properties

### Private key

key: Buffer

- Defined in crypto.ts:232

## Methods

### createPublic

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

- - Defined in crypto.ts:253

  Derive the public key for this private key.

  #### Parameters

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

  #### Returns PublicKey

### inspect

- inspect(): string

- - Defined in crypto.ts:268

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

  Sign message.

  #### Parameters

  - ##### message: Buffer

    32-byte message.

  #### Returns Signature

### toString

- toString(): string

- - Defined in crypto.ts:260

  Return a WIF-encoded representation of the key.

  #### Returns string

### Static from

- from(value: string | Buffer): PrivateKey

- - Defined in crypto.ts:202

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

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

  Create a new instance from a seed.

  #### Parameters

  - ##### seed: string

  #### Returns PrivateKey

### Static fromString

- fromString(wif: string): PrivateKey

- - Defined in crypto.ts:213

  Create a new instance from a WIF-encoded key.

  #### Parameters

  - ##### wif: string

  #### Returns PrivateKey

Generated using TypeDoc