Skip to content

PrivateKey⚓︎

PrivateKey
Represents a private key.

Extends⚓︎

Constructors⚓︎

new PrivateKey()⚓︎

new PrivateKey(privateKey): PrivateKey

Creates a private key from bytes or a hex string.

Parameters⚓︎

Parameter Type Description
privateKey string | Uint8Array<ArrayBufferLike> Input string or byte array.

Returns⚓︎

PrivateKey

Overrides⚓︎

ByteArray.constructor

Properties⚓︎

Property Modifier Type Description Inherited from
bytes public Uint8Array<ArrayBuffer> Underlying bytes. ByteArray.bytes
NAME static string Byte array name (required because constructor.name is dropped during minification). ByteArray.NAME
SIZE static number Byte size of raw private key. -

Methods⚓︎

toJson()⚓︎

toJson(): string
PrivateKey.toJson
Returns representation of this object that can be stored in JSON.

Returns⚓︎

string

JSON-safe representation of this object.

Inherited from⚓︎

ByteArray.toJson


toString()⚓︎

toString(): string
PrivateKey.toString
Returns string representation of this object.

Returns⚓︎

string

String representation of this object

Inherited from⚓︎

ByteArray.toString


random()⚓︎

static random(): PrivateKey
PrivateKey.random
Creates a random private key.

Returns⚓︎

PrivateKey

Random private key.