Skip to main content

Class: KeyPair

utils/key_pair.KeyPair

Hierarchy

Constructors

constructor

new KeyPair()

Methods

getPublicKey

Abstract getPublicKey(): PublicKey

Returns

PublicKey

Defined in

utils/key_pair.ts:72


sign

Abstract sign(message): Signature

Parameters

NameType
messageUint8Array

Returns

Signature

Defined in

utils/key_pair.ts:69


toString

Abstract toString(): string

Returns

string

Defined in

utils/key_pair.ts:71


verify

Abstract verify(message, signature): boolean

Parameters

NameType
messageUint8Array
signatureUint8Array

Returns

boolean

Defined in

utils/key_pair.ts:70


fromRandom

Static fromRandom(curve): KeyPair

Parameters

NameTypeDescription
curvestringName of elliptical curve, case-insensitive

Returns

KeyPair

Random KeyPair based on the curve

Defined in

utils/key_pair.ts:78


fromString

Static fromString(encodedKey): KeyPair

Parameters

NameType
encodedKeystring

Returns

KeyPair

Defined in

utils/key_pair.ts:85