Skip to main content

PrivateKey

Class: PrivateKey

Implements

  • PrivateKey

Constructors

constructor

new PrivateKey(obj)

Parameters

NameType
objPrivateKey

Defined in

crypto/PrivateKey.ts:181

Properties

publicKey

publicKey: PublicKey

Implementation of

privateKey.PrivateKey.publicKey

Defined in

crypto/PrivateKey.ts:179


secp256k1

secp256k1: secp256k1

Implementation of

privateKey.PrivateKey.secp256k1

Defined in

crypto/PrivateKey.ts:178


timestamp

timestamp: Long

Implementation of

privateKey.PrivateKey.timestamp

Defined in

crypto/PrivateKey.ts:177

Methods

decrypt

decrypt(encrypted, peer, additionalData?): Promise<Uint8Array>

Parameters

NameType
encrypteddefault
peerPublicKey
additionalData?Uint8Array

Returns

Promise<Uint8Array>

Defined in

crypto/PrivateKey.ts:262


encrypt

encrypt(plain, peer, additionalData?): Promise<default>

Parameters

NameType
plainUint8Array
peerPublicKey
additionalData?Uint8Array

Returns

Promise<default>

Defined in

crypto/PrivateKey.ts:251


generated

generated(): undefined | Date

Returns

undefined | Date

Defined in

crypto/PrivateKey.ts:212


matches

matches(key): boolean

Parameters

NameType
keyPublicKey

Returns

boolean

Defined in

crypto/PrivateKey.ts:272


sharedSecret

sharedSecret(peer): Uint8Array

Parameters

NameType
peerSignedPublicKey | PublicKey

Returns

Uint8Array

Defined in

crypto/PrivateKey.ts:240


sign

sign(digest): Promise<default>

Parameters

NameType
digestUint8Array

Returns

Promise<default>

Defined in

crypto/PrivateKey.ts:217


signKey

signKey(pub): Promise<PublicKey>

Parameters

NameType
pubPublicKey

Returns

Promise<PublicKey>

Defined in

crypto/PrivateKey.ts:232


toBytes

toBytes(): Uint8Array

Returns

Uint8Array

Defined in

crypto/PrivateKey.ts:277


fromBytes

Static fromBytes(bytes): PrivateKey

Parameters

NameType
bytesUint8Array

Returns

PrivateKey

Defined in

crypto/PrivateKey.ts:282


generate

Static generate(): PrivateKey

Returns

PrivateKey

Defined in

crypto/PrivateKey.ts:195