diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 6ee62f0f2dc742..c4a1cad106c3d6 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -168,15 +168,15 @@ console.log(encrypted); // Prints: ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504 ``` -### cipher.final([output_encoding]) +### cipher.final([outputEncoding]) -- `output_encoding` {string} +- `outputEncoding` {string} -Returns any remaining enciphered contents. If `output_encoding` +Returns any remaining enciphered contents. If `outputEncoding` parameter is one of `'latin1'`, `'base64'` or `'hex'`, a string is returned. -If an `output_encoding` is not provided, a [`Buffer`][] is returned. +If an `outputEncoding` is not provided, a [`Buffer`][] is returned. Once the `cipher.final()` method has been called, the `Cipher` object can no longer be used to encrypt data. Attempts to call `cipher.final()` more than @@ -207,18 +207,18 @@ the _authentication tag_ that has been computed from the given data. The `cipher.getAuthTag()` method should only be called after encryption has been completed using the [`cipher.final()`][] method. -### cipher.setAutoPadding([auto_padding]) +### cipher.setAutoPadding([autoPadding]) -- `auto_padding` {boolean} Defaults to `true`. +- `autoPadding` {boolean} Defaults to `true`. - Returns the {Cipher} for method chaining. When using block encryption algorithms, the `Cipher` class will automatically add padding to the input data to the appropriate block size. To disable the default padding call `cipher.setAutoPadding(false)`. -When `auto_padding` is `false`, the length of the entire input data must be a +When `autoPadding` is `false`, the length of the entire input data must be a multiple of the cipher's block size or [`cipher.final()`][] will throw an Error. Disabling automatic padding is useful for non-standard padding, for instance using `0x0` instead of PKCS padding. @@ -226,29 +226,29 @@ using `0x0` instead of PKCS padding. The `cipher.setAutoPadding()` method must be called before [`cipher.final()`][]. -### cipher.update(data[, input_encoding][, output_encoding]) +### cipher.update(data[, inputEncoding][, outputEncoding]) - `data` {string | Buffer | TypedArray | DataView} -- `input_encoding` {string} -- `output_encoding` {string} +- `inputEncoding` {string} +- `outputEncoding` {string} -Updates the cipher with `data`. If the `input_encoding` argument is given, +Updates the cipher with `data`. If the `inputEncoding` argument is given, its value must be one of `'utf8'`, `'ascii'`, or `'latin1'` and the `data` -argument is a string using the specified encoding. If the `input_encoding` +argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a [`Buffer`][], `TypedArray`, or `DataView`. If `data` is a [`Buffer`][], `TypedArray`, or `DataView`, then -`input_encoding` is ignored. +`inputEncoding` is ignored. -The `output_encoding` specifies the output format of the enciphered -data, and can be `'latin1'`, `'base64'` or `'hex'`. If the `output_encoding` +The `outputEncoding` specifies the output format of the enciphered +data, and can be `'latin1'`, `'base64'` or `'hex'`. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no -`output_encoding` is provided, a [`Buffer`][] is returned. +`outputEncoding` is provided, a [`Buffer`][] is returned. The `cipher.update()` method can be called multiple times with new data until [`cipher.final()`][] is called. Calling `cipher.update()` after @@ -321,15 +321,15 @@ console.log(decrypted); // Prints: some clear text data ``` -### decipher.final([output_encoding]) +### decipher.final([outputEncoding]) -- `output_encoding` {string} +- `outputEncoding` {string} -Returns any remaining deciphered contents. If `output_encoding` +Returns any remaining deciphered contents. If `outputEncoding` parameter is one of `'latin1'`, `'ascii'` or `'utf8'`, a string is returned. -If an `output_encoding` is not provided, a [`Buffer`][] is returned. +If an `outputEncoding` is not provided, a [`Buffer`][] is returned. Once the `decipher.final()` method has been called, the `Decipher` object can no longer be used to decrypt data. Attempts to call `decipher.final()` more @@ -372,11 +372,11 @@ cipher text should be discarded due to failed authentication. The `decipher.setAuthTag()` method must be called before [`decipher.final()`][]. -### decipher.setAutoPadding([auto_padding]) +### decipher.setAutoPadding([autoPadding]) -- `auto_padding` {boolean} Defaults to `true`. +- `autoPadding` {boolean} Defaults to `true`. - Returns the {Cipher} for method chaining. When data has been encrypted without standard block padding, calling @@ -389,28 +389,28 @@ multiple of the ciphers block size. The `decipher.setAutoPadding()` method must be called before [`decipher.final()`][]. -### decipher.update(data[, input_encoding][, output_encoding]) +### decipher.update(data[, inputEncoding][, outputEncoding]) - `data` {string | Buffer | TypedArray | DataView} -- `input_encoding` {string} -- `output_encoding` {string} +- `inputEncoding` {string} +- `outputEncoding` {string} -Updates the decipher with `data`. If the `input_encoding` argument is given, +Updates the decipher with `data`. If the `inputEncoding` argument is given, its value must be one of `'latin1'`, `'base64'`, or `'hex'` and the `data` -argument is a string using the specified encoding. If the `input_encoding` +argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a [`Buffer`][]. If `data` is a -[`Buffer`][] then `input_encoding` is ignored. +[`Buffer`][] then `inputEncoding` is ignored. -The `output_encoding` specifies the output format of the enciphered -data, and can be `'latin1'`, `'ascii'` or `'utf8'`. If the `output_encoding` +The `outputEncoding` specifies the output format of the enciphered +data, and can be `'latin1'`, `'ascii'` or `'utf8'`. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no -`output_encoding` is provided, a [`Buffer`][] is returned. +`outputEncoding` is provided, a [`Buffer`][] is returned. The `decipher.update()` method can be called multiple times with new data until [`decipher.final()`][] is called. Calling `decipher.update()` after @@ -447,23 +447,23 @@ const bobSecret = bob.computeSecret(aliceKey); assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); ``` -### diffieHellman.computeSecret(other_public_key[, input_encoding][, output_encoding]) +### diffieHellman.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding]) -- `other_public_key` {string | Buffer | TypedArray | DataView} -- `input_encoding` {string} -- `output_encoding` {string} +- `otherPublicKey` {string | Buffer | TypedArray | DataView} +- `inputEncoding` {string} +- `outputEncoding` {string} -Computes the shared secret using `other_public_key` as the other +Computes the shared secret using `otherPublicKey` 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 -`'latin1'`, `'hex'`, or `'base64'`. If the `input_encoding` is not -provided, `other_public_key` is expected to be a [`Buffer`][], +key is interpreted using the specified `inputEncoding`, and secret is +encoded using specified `outputEncoding`. Encodings can be +`'latin1'`, `'hex'`, or `'base64'`. If the `inputEncoding` is not +provided, `otherPublicKey` is expected to be a [`Buffer`][], `TypedArray`, or `DataView`. -If `output_encoding` is given a string is returned; otherwise, a +If `outputEncoding` is given a string is returned; otherwise, a [`Buffer`][] is returned. ### diffieHellman.generateKeys([encoding]) @@ -518,28 +518,28 @@ Returns the Diffie-Hellman public key in the specified `encoding`, which can be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is returned; otherwise a [`Buffer`][] is returned. -### diffieHellman.setPrivateKey(private_key[, encoding]) +### diffieHellman.setPrivateKey(privateKey[, encoding]) -- `private_key` {string | Buffer | TypedArray | DataView} +- `privateKey` {string | Buffer | TypedArray | DataView} - `encoding` {string} Sets the Diffie-Hellman private key. If the `encoding` argument is provided -and is either `'latin1'`, `'hex'`, or `'base64'`, `private_key` is expected -to be a string. If no `encoding` is provided, `private_key` is expected +and is either `'latin1'`, `'hex'`, or `'base64'`, `privateKey` is expected +to be a string. If no `encoding` is provided, `privateKey` is expected to be a [`Buffer`][], `TypedArray`, or `DataView`. -### diffieHellman.setPublicKey(public_key[, encoding]) +### diffieHellman.setPublicKey(publicKey[, encoding]) -- `public_key` {string | Buffer | TypedArray | DataView} +- `publicKey` {string | Buffer | TypedArray | DataView} - `encoding` {string} Sets the Diffie-Hellman public key. If the `encoding` argument is provided -and is either `'latin1'`, `'hex'` or `'base64'`, `public_key` is expected -to be a string. If no `encoding` is provided, `public_key` is expected +and is either `'latin1'`, `'hex'` or `'base64'`, `publicKey` is expected +to be a string. If no `encoding` is provided, `publicKey` is expected to be a [`Buffer`][], `TypedArray`, or `DataView`. ### diffieHellman.verifyError @@ -589,27 +589,27 @@ assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); // OK ``` -### ecdh.computeSecret(other_public_key[, input_encoding][, output_encoding]) +### ecdh.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding]) -- `other_public_key` {string | Buffer | TypedArray | DataView} -- `input_encoding` {string} -- `output_encoding` {string} +- `otherPublicKey` {string | Buffer | TypedArray | DataView} +- `inputEncoding` {string} +- `outputEncoding` {string} -Computes the shared secret using `other_public_key` as the other +Computes the shared secret using `otherPublicKey` 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 -`'latin1'`, `'hex'`, or `'base64'`. If the `input_encoding` is not -provided, `other_public_key` is expected to be a [`Buffer`][], `TypedArray`, or +key is interpreted using specified `inputEncoding`, and the returned secret +is encoded using the specified `outputEncoding`. Encodings can be +`'latin1'`, `'hex'`, or `'base64'`. If the `inputEncoding` is not +provided, `otherPublicKey` is expected to be a [`Buffer`][], `TypedArray`, or `DataView`. -If `output_encoding` is given a string will be returned; otherwise a +If `outputEncoding` is given a string will be returned; otherwise a [`Buffer`][] is returned. ### ecdh.generateKeys([encoding[, format]]) @@ -659,23 +659,23 @@ The `encoding` argument can be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is specified, a string is returned; otherwise a [`Buffer`][] is returned. -### ecdh.setPrivateKey(private_key[, encoding]) +### ecdh.setPrivateKey(privateKey[, encoding]) -- `private_key` {string | Buffer | TypedArray | DataView} +- `privateKey` {string | Buffer | TypedArray | DataView} - `encoding` {string} Sets the EC Diffie-Hellman private key. The `encoding` can be `'latin1'`, -`'hex'` or `'base64'`. If `encoding` is provided, `private_key` is expected -to be a string; otherwise `private_key` is expected to be a [`Buffer`][], +`'hex'` or `'base64'`. If `encoding` is provided, `privateKey` is expected +to be a string; otherwise `privateKey` is expected to be a [`Buffer`][], `TypedArray`, or `DataView`. -If `private_key` is not valid for the curve specified when the `ECDH` object was +If `privateKey` 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.setPublicKey(public_key[, encoding]) +### ecdh.setPublicKey(publicKey[, encoding]) - `data` {string | Buffer | TypedArray | DataView} -- `input_encoding` {string} +- `inputEncoding` {string} Updates the hash content with the given `data`, the encoding of which -is given in `input_encoding` and can be `'utf8'`, `'ascii'` or +is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or `'latin1'`. If `encoding` is not provided, and the `data` is a string, an encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][], `TypedArray`, or -`DataView`, then `input_encoding` is ignored. +`DataView`, then `inputEncoding` is ignored. This can be called many times with new data as it is streamed. @@ -882,22 +882,22 @@ provided a string is returned; otherwise a [`Buffer`][] is returned; The `Hmac` object can not be used again after `hmac.digest()` has been called. Multiple calls to `hmac.digest()` will result in an error being thrown. -### hmac.update(data[, input_encoding]) +### hmac.update(data[, inputEncoding]) - `data` {string | Buffer | TypedArray | DataView} -- `input_encoding` {string} +- `inputEncoding` {string} Updates the `Hmac` content with the given `data`, the encoding of which -is given in `input_encoding` and can be `'utf8'`, `'ascii'` or +is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or `'latin1'`. If `encoding` is not provided, and the `data` is a string, an encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][], `TypedArray`, or -`DataView`, then `input_encoding` is ignored. +`DataView`, then `inputEncoding` is ignored. This can be called many times with new data as it is streamed. @@ -967,7 +967,7 @@ pQhByd5eyj3lgZ7m7jbchtdgyOF8Io/1ng== console.log(sign.sign(privateKey).toString('hex')); ``` -### sign.sign(private_key[, output_format]) +### sign.sign(privateKey[, outputFormat]) -- `private_key` {string | Object} +- `privateKey` {string | Object} - `key` {string} - `passphrase` {string} -- `output_format` {string} +- `outputFormat` {string} Calculates the signature on all the data passed through using either [`sign.update()`][] or [`sign.write()`][stream-writable-write]. -The `private_key` argument can be an object or a string. If `private_key` is a -string, it is treated as a raw key with no passphrase. If `private_key` is an +The `privateKey` argument can be an object or a string. If `privateKey` is a +string, it is treated as a raw key with no passphrase. If `privateKey` is an object, it must contain one or more of the following properties: * `key`: {string} - PEM encoded private key (required) @@ -1001,29 +1001,29 @@ object, it must contain one or more of the following properties: size, `crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN` (default) sets it to the maximum permissible value. -The `output_format` can specify one of `'latin1'`, `'hex'` or `'base64'`. If -`output_format` is provided a string is returned; otherwise a [`Buffer`][] is +The `outputFormat` can specify one of `'latin1'`, `'hex'` or `'base64'`. If +`outputFormat` is provided a string is returned; otherwise a [`Buffer`][] is returned. The `Sign` object can not be again used after `sign.sign()` method has been called. Multiple calls to `sign.sign()` will result in an error being thrown. -### sign.update(data[, input_encoding]) +### sign.update(data[, inputEncoding]) - `data` {string | Buffer | TypedArray | DataView} -- `input_encoding` {string} +- `inputEncoding` {string} Updates the `Sign` content with the given `data`, the encoding of which -is given in `input_encoding` and can be `'utf8'`, `'ascii'` or +is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or `'latin1'`. If `encoding` is not provided, and the `data` is a string, an encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][], `TypedArray`, or -`DataView`, then `input_encoding` is ignored. +`DataView`, then `inputEncoding` is ignored. This can be called many times with new data as it is streamed. @@ -1072,26 +1072,26 @@ console.log(verify.verify(publicKey, signature)); // Prints: true or false ``` -### verifier.update(data[, input_encoding]) +### verifier.update(data[, inputEncoding]) - `data` {string | Buffer | TypedArray | DataView} -- `input_encoding` {string} +- `inputEncoding` {string} Updates the `Verify` content with the given `data`, the encoding of which -is given in `input_encoding` and can be `'utf8'`, `'ascii'` or +is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or `'latin1'`. If `encoding` is not provided, and the `data` is a string, an encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][], `TypedArray`, or -`DataView`, then `input_encoding` is ignored. +`DataView`, then `inputEncoding` is ignored. This can be called many times with new data as it is streamed. -### verifier.verify(object, signature[, signature_format]) +### verifier.verify(object, signature[, signatureFormat]) - `object` {string | Object} - `signature` {string | Buffer | TypedArray | DataView} -- `signature_format` {string} +- `signatureFormat` {string} Verifies the provided data using the given `object` and `signature`. The `object` argument can be either a string containing a PEM encoded object, @@ -1122,8 +1122,8 @@ or an object with one or more of the following properties: determined automatically. The `signature` argument is the previously calculated signature for the data, in -the `signature_format` which can be `'latin1'`, `'hex'` or `'base64'`. -If a `signature_format` is specified, the `signature` is expected to be a +the `signatureFormat` which can be `'latin1'`, `'hex'` or `'base64'`. +If a `signatureFormat` is specified, the `signature` is expected to be a string; otherwise `signature` is expected to be a [`Buffer`][], `TypedArray`, or `DataView`. @@ -1273,7 +1273,7 @@ The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector][]. Both arguments must be `'utf8'` encoded strings or [buffers][`Buffer`]. -### crypto.createDiffieHellman(prime[, prime_encoding][, generator][, generator_encoding]) +### crypto.createDiffieHellman(prime[, primeEncoding][, generator][, generatorEncoding]) - `prime` {string | Buffer | TypedArray | DataView} -- `prime_encoding` {string} +- `primeEncoding` {string} - `generator` {number | string | Buffer | TypedArray | DataView} Defaults to `2`. -- `generator_encoding` {string} +- `generatorEncoding` {string} Creates a `DiffieHellman` key exchange object using the supplied `prime` and an optional specific `generator`. @@ -1299,34 +1299,34 @@ optional specific `generator`. The `generator` argument can be a number, string, or [`Buffer`][]. If `generator` is not specified, the value `2` is used. -The `prime_encoding` and `generator_encoding` arguments can be `'latin1'`, +The `primeEncoding` and `generatorEncoding` arguments can be `'latin1'`, `'hex'`, or `'base64'`. -If `prime_encoding` is specified, `prime` is expected to be a string; otherwise +If `primeEncoding` is specified, `prime` is expected to be a string; otherwise a [`Buffer`][], `TypedArray`, or `DataView` is expected. -If `generator_encoding` is specified, `generator` is expected to be a string; +If `generatorEncoding` is specified, `generator` is expected to be a string; otherwise a number, [`Buffer`][], `TypedArray`, or `DataView` is expected. -### crypto.createDiffieHellman(prime_length[, generator]) +### crypto.createDiffieHellman(primeLength[, generator]) -- `prime_length` {number} +- `primeLength` {number} - `generator` {number | string | Buffer | TypedArray | DataView} Defaults to `2`. Creates a `DiffieHellman` key exchange object and generates a prime of -`prime_length` bits using an optional specific numeric `generator`. +`primeLength` bits using an optional specific numeric `generator`. If `generator` is not specified, the value `2` is used. -### crypto.createECDH(curve_name) +### crypto.createECDH(curveName) -- `curve_name` {string} +- `curveName` {string} Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a -predefined curve specified by the `curve_name` string. Use +predefined curve specified by the `curveName` string. Use [`crypto.getCurves()`][] to obtain a list of available curve names. On recent OpenSSL releases, `openssl ecparam -list_curves` will also display the name and description of each available elliptic curve. @@ -1449,11 +1449,11 @@ const curves = crypto.getCurves(); console.log(curves); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] ``` -### crypto.getDiffieHellman(group_name) +### crypto.getDiffieHellman(groupName) -- `group_name` {string} +- `groupName` {string} Creates a predefined `DiffieHellman` key exchange object. The supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in @@ -1599,11 +1599,11 @@ console.log(key.toString('hex')); // '3745e48...aa39b34' An array of supported digest functions can be retrieved using [`crypto.getHashes()`][]. -### crypto.privateDecrypt(private_key, buffer) +### crypto.privateDecrypt(privateKey, buffer) -- `private_key` {Object | string} +- `privateKey` {Object | string} - `key` {string} A PEM encoded private key. - `passphrase` {string} An optional passphrase for the private key. - `padding` {crypto.constants} An optional padding value defined in @@ -1611,16 +1611,16 @@ added: v0.11.14 `RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`. - `buffer` {Buffer | TypedArray | DataView} -Decrypts `buffer` with `private_key`. +Decrypts `buffer` with `privateKey`. -`private_key` can be an object or a string. If `private_key` is a string, it is +`privateKey` can be an object or a string. If `privateKey` is a string, it is treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. -### crypto.privateEncrypt(private_key, buffer) +### crypto.privateEncrypt(privateKey, buffer) -- `private_key` {Object | string} +- `privateKey` {Object | string} - `key` {string} A PEM encoded private key. - `passphrase` {string} An optional passphrase for the private key. - `padding` {crypto.constants} An optional padding value defined in @@ -1628,16 +1628,16 @@ added: v1.1.0 `RSA_PKCS1_PADDING`. - `buffer` {Buffer | TypedArray | DataView} -Encrypts `buffer` with `private_key`. +Encrypts `buffer` with `privateKey`. -`private_key` can be an object or a string. If `private_key` is a string, it is +`privateKey` can be an object or a string. If `privateKey` is a string, it is treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. -### crypto.publicDecrypt(public_key, buffer) +### crypto.publicDecrypt(publicKey, buffer) -- `public_key` {Object | string} +- `publicKey` {Object | string} - `key` {string} A PEM encoded private key. - `passphrase` {string} An optional passphrase for the private key. - `padding` {crypto.constants} An optional padding value defined in @@ -1645,19 +1645,19 @@ added: v1.1.0 `RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`. - `buffer` {Buffer | TypedArray | DataView} -Decrypts `buffer` with `public_key`. +Decrypts `buffer` with `publicKey`. -`public_key` can be an object or a string. If `public_key` is a string, it is +`publicKey` can be an object or a string. If `publicKey` is a string, it is treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. Because RSA public keys can be derived from private keys, a private key may be passed instead of a public key. -### crypto.publicEncrypt(public_key, buffer) +### crypto.publicEncrypt(publicKey, buffer) -- `public_key` {Object | string} +- `publicKey` {Object | string} - `key` {string} A PEM encoded private key. - `passphrase` {string} An optional passphrase for the private key. - `padding` {crypto.constants} An optional padding value defined in @@ -1665,10 +1665,10 @@ added: v0.11.14 `RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`. - `buffer` {Buffer | TypedArray | DataView} -Encrypts the content of `buffer` with `public_key` and returns a new +Encrypts the content of `buffer` with `publicKey` and returns a new [`Buffer`][] with encrypted content. -`public_key` can be an object or a string. If `public_key` is a string, it is +`publicKey` can be an object or a string. If `publicKey` is a string, it is treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. Because RSA public keys can be derived from private keys, a private key may @@ -2201,14 +2201,14 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL. [`Buffer`]: buffer.html [`EVP_BytesToKey`]: https://www.openssl.org/docs/man1.0.2/crypto/EVP_BytesToKey.html -[`cipher.final()`]: #crypto_cipher_final_output_encoding -[`cipher.update()`]: #crypto_cipher_update_data_input_encoding_output_encoding +[`cipher.final()`]: #crypto_cipher_final_outputencoding +[`cipher.update()`]: #crypto_cipher_update_data_inputencoding_outputencoding [`crypto.createCipher()`]: #crypto_crypto_createcipher_algorithm_password [`crypto.createCipheriv()`]: #crypto_crypto_createcipheriv_algorithm_key_iv [`crypto.createDecipher()`]: #crypto_crypto_createdecipher_algorithm_password [`crypto.createDecipheriv()`]: #crypto_crypto_createdecipheriv_algorithm_key_iv -[`crypto.createDiffieHellman()`]: #crypto_crypto_creatediffiehellman_prime_prime_encoding_generator_generator_encoding -[`crypto.createECDH()`]: #crypto_crypto_createecdh_curve_name +[`crypto.createDiffieHellman()`]: #crypto_crypto_creatediffiehellman_prime_primeencoding_generator_generatorencoding +[`crypto.createECDH()`]: #crypto_crypto_createecdh_curvename [`crypto.createHash()`]: #crypto_crypto_createhash_algorithm [`crypto.createHmac()`]: #crypto_crypto_createhmac_algorithm_key [`crypto.createSign()`]: #crypto_crypto_createsign_algorithm @@ -2218,21 +2218,21 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL. [`crypto.pbkdf2()`]: #crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback [`crypto.randomBytes()`]: #crypto_crypto_randombytes_size_callback [`crypto.randomFill()`]: #crypto_crypto_randomfill_buffer_offset_size_callback -[`decipher.final()`]: #crypto_decipher_final_output_encoding -[`decipher.update()`]: #crypto_decipher_update_data_input_encoding_output_encoding -[`diffieHellman.setPublicKey()`]: #crypto_diffiehellman_setpublickey_public_key_encoding +[`decipher.final()`]: #crypto_decipher_final_outputencoding +[`decipher.update()`]: #crypto_decipher_update_data_inputencoding_outputencoding +[`diffieHellman.setPublicKey()`]: #crypto_diffiehellman_setpublickey_publickey_encoding [`ecdh.generateKeys()`]: #crypto_ecdh_generatekeys_encoding_format -[`ecdh.setPrivateKey()`]: #crypto_ecdh_setprivatekey_private_key_encoding -[`ecdh.setPublicKey()`]: #crypto_ecdh_setpublickey_public_key_encoding +[`ecdh.setPrivateKey()`]: #crypto_ecdh_setprivatekey_privatekey_encoding +[`ecdh.setPublicKey()`]: #crypto_ecdh_setpublickey_publickey_encoding [`hash.digest()`]: #crypto_hash_digest_encoding -[`hash.update()`]: #crypto_hash_update_data_input_encoding +[`hash.update()`]: #crypto_hash_update_data_inputencoding [`hmac.digest()`]: #crypto_hmac_digest_encoding -[`hmac.update()`]: #crypto_hmac_update_data_input_encoding -[`sign.sign()`]: #crypto_sign_sign_private_key_output_format -[`sign.update()`]: #crypto_sign_update_data_input_encoding +[`hmac.update()`]: #crypto_hmac_update_data_inputencoding +[`sign.sign()`]: #crypto_sign_sign_privatekey_outputformat +[`sign.update()`]: #crypto_sign_update_data_inputencoding [`tls.createSecureContext()`]: tls.html#tls_tls_createsecurecontext_options -[`verify.update()`]: #crypto_verifier_update_data_input_encoding -[`verify.verify()`]: #crypto_verifier_verify_object_signature_signature_format +[`verify.update()`]: #crypto_verifier_update_data_inputencoding +[`verify.verify()`]: #crypto_verifier_verify_object_signature_signatureformat [Caveats]: #crypto_support_for_weak_or_compromised_algorithms [Crypto Constants]: #crypto_crypto_constants_1 [HTML5's `keygen` element]: http://www.w3.org/TR/html5/forms.html#the-keygen-element diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index caa8ef04efec6c..d06e70a10c9e30 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -646,7 +646,7 @@ Type: Runtime [`crypto.createCredentials()`]: crypto.html#crypto_crypto_createcredentials_details [`crypto.pbkdf2()`]: crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback [`domain`]: domain.html -[`ecdh.setPublicKey()`]: crypto.html#crypto_ecdh_setpublickey_public_key_encoding +[`ecdh.setPublicKey()`]: crypto.html#crypto_ecdh_setpublickey_publickey_encoding [`emitter.listenerCount(eventName)`]: events.html#events_emitter_listenercount_eventname [`fs.access()`]: fs.html#fs_fs_access_path_mode_callback [`fs.exists(path, callback)`]: fs.html#fs_fs_exists_path_callback diff --git a/doc/api/http.md b/doc/api/http.md index b19ffb6d8e1fb0..adbe2eaa59fcc5 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -496,7 +496,7 @@ added: v0.11.14 If a request has been aborted, this value is the time when the request was aborted, in milliseconds since 1 January 1970 00:00:00 UTC. -### request.end([data][, encoding][, callback]) +### request.end([data[, encoding]][, callback]) diff --git a/doc/api/path.md b/doc/api/path.md index 0bc6c88ded3b24..34963ae5eb3ebd 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -369,11 +369,11 @@ see [`path.sep`][]. The returned object will have the following properties: -* `root` {string} * `dir` {string} +* `root` {string} * `base` {string} -* `ext` {string} * `name` {string} +* `ext` {string} For example on POSIX: diff --git a/doc/api/tls.md b/doc/api/tls.md index 94db2dea67b2f1..80cd2e87263566 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -391,8 +391,11 @@ when the server has no more open connections. ### server.connections +> Stability: 0 - Deprecated: Use [`server.getConnections()`][] instead. + Returns the current number of concurrent connections on the server. ### server.getTicketKeys() @@ -585,7 +588,7 @@ if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The For Example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }` -### tlsSocket.getPeerCertificate([ detailed ]) +### tlsSocket.getPeerCertificate([detailed]) @@ -1272,6 +1275,7 @@ where `secure_socket` has the same API as `pair.cleartext`. [`net.Server.address()`]: net.html#net_server_address [`net.Server`]: net.html#net_class_net_server [`net.Socket`]: net.html#net_class_net_socket +[`server.getConnections()`]: net.html#net_server_getconnections_callback [`tls.DEFAULT_ECDH_CURVE`]: #tls_tls_default_ecdh_curve [`tls.TLSSocket.getPeerCertificate()`]: #tls_tlssocket_getpeercertificate_detailed [`tls.TLSSocket`]: #tls_class_tls_tlssocket diff --git a/doc/api/vm.md b/doc/api/vm.md index 288dcaf9e383d1..42046e01191b51 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -129,7 +129,7 @@ console.log(util.inspect(sandbox)); event loops and corresponding threads being started, which have a non-zero performance overhead. -### script.runInNewContext([sandbox][, options]) +### script.runInNewContext([sandbox[, options]]) @@ -473,7 +473,7 @@ According to the [V8 Embedder's Guide][]: When the method `vm.createContext()` is called, the `sandbox` object that is passed in (or a newly created object if `sandbox` is `undefined`) is associated internally with a new instance of a V8 Context. This V8 Context provides the -`code` run using the `vm` modules methods with an isolated global environment +`code` run using the `vm` module's methods with an isolated global environment within which it can operate. The process of creating the V8 Context and associating it with the `sandbox` object is what this document refers to as "contextifying" the `sandbox`. diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 462103bd642813..4f9423585ff236 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -440,14 +440,14 @@ Provides an object enumerating Zlib-related constants. added: v0.5.8 --> -Returns a new [Deflate][] object with an [options][]. +Creates and returns a new [Deflate][] object with the given [options][]. ## zlib.createDeflateRaw([options]) -Returns a new [DeflateRaw][] object with an [options][]. +Creates and returns a new [DeflateRaw][] object with the given [options][]. *Note*: The zlib library rejects requests for 256-byte windows (i.e., `{ windowBits: 8 }` in `options`). An `Error` will be thrown when creating @@ -458,35 +458,35 @@ a [DeflateRaw][] object with this specific value of the `windowBits` option. added: v0.5.8 --> -Returns a new [Gunzip][] object with an [options][]. +Creates and returns a new [Gunzip][] object with the given [options][]. ## zlib.createGzip([options]) -Returns a new [Gzip][] object with an [options][]. +Creates and returns a new [Gzip][] object with the given [options][]. ## zlib.createInflate([options]) -Returns a new [Inflate][] object with an [options][]. +Creates and returns a new [Inflate][] object with the given [options][]. ## zlib.createInflateRaw([options]) -Returns a new [InflateRaw][] object with an [options][]. +Creates and returns a new [InflateRaw][] object with the given [options][]. ## zlib.createUnzip([options]) -Returns a new [Unzip][] object with an [options][]. +Creates and returns a new [Unzip][] object with the given [options][]. ## Convenience Methods