ecdh.getPrivateKey()

ecdh.getPrivateKey([encoding]) Returns the EC Diffie-Hellman private key in the specified encoding, which can be 'binary', 'hex', or 'base64'. If encoding is provided a string is returned; otherwise a Buffer is returned.

ecdh.setPrivateKey()

ecdh.setPrivateKey(private_key[, encoding]) Sets the EC Diffie-Hellman private key. The encoding can be 'binary', 'hex' or 'base64'. If encoding is provided, private_key is expected to be a string; otherwise private_key is expected to be a Buffer. If private_key is not valid for the curve specified when the ECDH object was created, an error is thrown. Upon setting the private key, the associated public point (key) is also generated and set in the ECDH object.

ecdh.generateKeys()

ecdh.generateKeys([encoding[, format]]) Generates private and public EC Diffie-Hellman key values, and returns the public key in the specified format and encoding. This key should be transferred to the other party. The format arguments specifies point encoding and can be 'compressed', 'uncompressed', or 'hybrid'. If format is not specified, the point will be returned in 'uncompressed' format. The encoding argument can be 'binary', 'hex', or 'base64'. If encoding is provided a string is return

ECDH

Class: ECDH The ECDH class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) key exchanges. Instances of the ECDH class can be created using the crypto.createECDH() function. const crypto = require('crypto'); const assert = require('assert'); // Generate Alice's keys... const alice = crypto.createECDH('secp521r1'); const alice_key = alice.generateKeys(); // Generate Bob's keys... const bob = crypto.createECDH('secp521r1'); const bob_key = bob.generateKeys(); // Exchange and ge

ecdh.computeSecret()

ecdh.computeSecret(other_public_key[, input_encoding][, output_encoding]) Computes the shared secret using other_public_key as the other party's public key and returns the computed shared secret. The supplied key is interpreted using specified input_encoding, and the returned secret is encoded using the specified output_encoding. Encodings can be 'binary', 'hex', or 'base64'. If the input_encoding is not provided, other_public_key is expected to be a Buffer. If output_encoding is given a strin

drain event (stream.Writable)

Stability: 2 - Stable A stream is an abstract interface implemented by various objects in Node.js. For example a request to an HTTP server is a stream, as is process.stdout. Streams are readable, writable, or both. All streams are instances of EventEmitter. You can load the Stream base classes by doing require('stream'). There are base classes provided for Readable streams, Writable streams, Duplex streams, and Transform streams. This document is split up into 3 sections: The first section e

domain.members

domain.members <Array> An array of timers and event emitters that have been explicitly added to the domain.

domain.run()

domain.run(fn[, arg][, ...]) fn <Function> Run the supplied function in the context of the domain, implicitly binding all event emitters, timers, and lowlevel requests that are created in that context. Optionally, arguments can be passed to the function. This is the most basic way to use a domain. Example: const domain = require('domain'); const fs = require('fs'); const d = domain.create(); d.on('error', (er) => { console.error('Caught error!', er); }); d.run(() => { pro

drain event (net.Socket)

Event: 'drain' Emitted when the write buffer becomes empty. Can be used to throttle uploads. See also: the return values of socket.write()

domain.remove()

domain.remove(emitter) emitter <EventEmitter> | <Timer> emitter or timer to be removed from the domain The opposite of domain.add(emitter). Removes domain handling from the specified emitter.