diffieHellman.getPublicKey()

diffieHellman.getPublicKey([encoding]) Returns the Diffie-Hellman public 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.

diffieHellman.getPrime()

diffieHellman.getPrime([encoding]) Returns the Diffie-Hellman prime in the specified encoding, which can be 'binary', 'hex', or 'base64'. If encoding is provided a string is returned; otherwise a Buffer is returned.

diffieHellman.getGenerator()

diffieHellman.getGenerator([encoding]) Returns the Diffie-Hellman generator in the specified encoding, which can be 'binary', 'hex', or 'base64'. If encoding is provided a string is returned; otherwise a Buffer is returned.

diffieHellman.generateKeys()

diffieHellman.generateKeys([encoding]) Generates private and public Diffie-Hellman key values, and returns the public key in the specified encoding. This key should be transferred to the other party. Encoding can be 'binary', 'hex', or 'base64'. If encoding is provided a string is returned; otherwise a Buffer is returned.

diffieHellman.computeSecret()

diffieHellman.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 the specified input_encoding, and secret is encoded using 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 string is

DiffieHellman

Class: DiffieHellman The DiffieHellman class is a utility for creating Diffie-Hellman key exchanges. Instances of the DiffieHellman class can be created using the crypto.createDiffieHellman() function. const crypto = require('crypto'); const assert = require('assert'); // Generate Alice's keys... const alice = crypto.createDiffieHellman(2048); const alice_key = alice.generateKeys(); // Generate Bob's keys... const bob = crypto.createDiffieHellman(alice.getPrime(), alice.getGenerator()); con

dgram_socket.unref()

socket.unref() By default, binding a socket will cause it to block the Node.js process from exiting as long as the socket is open. The socket.unref() method can be used to exclude the socket from the reference counting that keeps the Node.js process active, allowing the process to exit even if the socket is still listening. Calling socket.unref() multiple times will have no addition effect. The socket.unref() method returns a reference to the socket so calls can be chained.

dgram_socket.setTTL()

socket.setTTL(ttl) ttl <Number> Integer Sets the IP_TTL socket option. While TTL generally stands for "Time to Live", in this context it specifies the number of IP hops that a packet is allowed to travel through. Each router or gateway that forwards a packet decrements the TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. Changing TTL values is typically done for network probes or when multicasting. The argument to socket.setTTL() is a number of hops between 1

dgram_socket.setBroadcast()

socket.setBroadcast(flag) flag <Boolean> Sets or clears the SO_BROADCAST socket option. When set to true, UDP packets may be sent to a local interface's broadcast address.

dgram_socket.setMulticastLoopback()

socket.setMulticastLoopback(flag) flag <Boolean> Sets or clears the IP_MULTICAST_LOOP socket option. When set to true, multicast packets will also be received on the local interface.