Skip to content

Latest commit

 

History

History
154 lines (88 loc) · 5.6 KB

API.md

File metadata and controls

154 lines (88 loc) · 5.6 KB

API Reference (v2.x)

#####.secretKeyVerify(Buffer secretKey) -> Boolean

Verify an ECDSA secretKey.


#####.secretKeyExport(Buffer secretKey [, Boolean compressed = true]) -> Buffer

Export a secretKey in DER format.


#####.secretKeyImport(Buffer secretKey) -> Buffer

Import a secretKey in DER format.


#####.secretKeyTweakAdd(Buffer secretKey, Buffer tweak) -> Buffer

Tweak a secretKey by adding tweak to it.


#####.secretKeyTweakMul(Buffer secretKey, Buffer tweak) -> Buffer

Tweak a secretKey by multiplying it by a tweak.


#####.publicKeyCreate(Buffer secretKey) -> Buffer

Compute the public key for a secretKey.


#####.publicKeyConvert(Buffer publicKey [, Boolean compressed = true]) -> Buffer

Convert a publicKey to compressed or uncompressed form.


#####.publicKeyVerify(Buffer publicKey) -> Boolean

Verify an ECDSA publicKey.


#####.publicKeyTweakAdd(Buffer publicKey, Buffer tweak) -> Buffer

Tweak a publicKey by adding tweak times the generator to it.


#####.publicKeyTweakMul(Buffer publicKey, Buffer tweak) -> Buffer

Tweak a publicKey by multiplying it by a tweak value.


#####.publicKeyCombine(Array<Buffer> publicKeys) -> Buffer

Add a given publicKeys together.


#####.signatureNormalize(Buffer signature) -> Buffer

Convert a signature to a normalized lower-S form.


#####.signatureExport(Buffer signature) -> Buffer

Serialize an ECDSA signature in DER format.


#####.signatureImport(Buffer signature) -> Buffer

Parse a DER ECDSA signature.


#####.sign(Buffer msg, Buffer secretKey [, Function callback]) -> Promise<{signature: Buffer, recovery: number}>

Create an ECDSA signature.


#####.signSync(Buffer msg, Buffer secretKey) -> {signature: Buffer, recovery: number}

Synchronous .sign. Returns an object {signature: Buffer, recovery: number}.


#####.verify(Buffer msg, Buffer signature, Buffer publicKey [, Function callback]) -> Promise<Boolean>

Verify an ECDSA signature.


#####.verifySync(Buffer msg, Buffer signature, Buffer publicKey -> Boolean

Synchronous .verify. Returns a Boolean.


#####.recover(Buffer msg, Buffer signature, Number recovery [, Function callback] -> Promise<Buffer>

Recover an ECDSA public key from a signature.


#####.recoverSync(Buffer msg, Buffer signature, Number recovery) -> Buffer

Synchronous .recover. Returns an instance of Buffer.


#####.ecdh(Buffer publicKey, Buffer secretKey [, Function callback]) -> Promise<Buffer>

Compute an EC Diffie-Hellman secret.


#####.ecdhSync(Buffer publicKey, Buffer secretKey) -> Buffer

Synchronous .ecdh. Returns an instance of Buffer.