Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed formatting errors and corrected types
  • Loading branch information
ashanhol committed Aug 16, 2017
commit a2806b4b871df46456a9ddf60d7f6b7701eaa000
53 changes: 29 additions & 24 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1170,16 +1170,16 @@ added: v6.0.0
Property for checking and controlling whether a FIPS compliant crypto provider is
currently in use. Setting to true requires a FIPS build of Node.js.

### crypto.createCipher(algorithm, password, options)
### crypto.createCipher(algorithm, password[, options])
<!-- YAML
added: v0.1.94
-->
- `algorithm` {string}
- `password` {string | Buffer | TypedArray | DataView}
- `options` {string}
- `options` {object} combined [OpenSSL options][] and [`stream.transform` options][]

Creates and returns a `Cipher` object that uses the given `algorithm` and
`password`. Optional `options` argument controls stream behavior via [OpenSSL Options](#openssl-options).
`password`. Optional `options` argument controls stream behavior.

The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
recent OpenSSL releases, `openssl list-cipher-algorithms` will display the
Expand All @@ -1201,14 +1201,14 @@ In line with OpenSSL's recommendation to use pbkdf2 instead of
their own using [`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][]
to create the `Cipher` object.

### crypto.createCipheriv(algorithm, key, iv, options)
### crypto.createCipheriv(algorithm, key, iv[, options])
- `algorithm` {string}
- `key` {string | Buffer | TypedArray | DataView}
- `iv` {string | Buffer | TypedArray | DataView}
- `options` {string}
- `options` {object} combined [OpenSSL options][] and [`stream.transform` options][]

Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
initialization vector (`iv`). Optional `options` argument controls stream behavior via [OpenSSL Options](#openssl-options).
initialization vector (`iv`). Optional `options` argument controls stream behavior.

The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
recent OpenSSL releases, `openssl list-cipher-algorithms` will display the
Expand Down Expand Up @@ -1236,16 +1236,16 @@ value.
Returns a `tls.SecureContext`, as-if [`tls.createSecureContext()`][] had been
called.

### crypto.createDecipher(algorithm, password, options)
### crypto.createDecipher(algorithm, password[, options])
<!-- YAML
added: v0.1.94
-->
- `algorithm` {string}
- `password` {string | Buffer | TypedArray | DataView}
- `options` {string}
- `options` {object} combined [OpenSSL options][] and [`stream.transform` options][]

Creates and returns a `Decipher` object that uses the given `algorithm` and
`password` (key). Optional `options` argument controls stream behavior via [OpenSSL Options](#openssl-options).
`password` (key). Optional `options` argument controls stream behavior.

The implementation of `crypto.createDecipher()` derives keys using the OpenSSL
function [`EVP_BytesToKey`][] with the digest algorithm set to MD5, one
Expand All @@ -1259,17 +1259,18 @@ In line with OpenSSL's recommendation to use pbkdf2 instead of
their own using [`crypto.pbkdf2()`][] and to use [`crypto.createDecipheriv()`][]
to create the `Decipher` object.

### crypto.createDecipheriv(algorithm, key, iv, options)
### crypto.createDecipheriv(algorithm, key, iv[, options])
<!-- YAML
added: v0.1.94
-->
- `algorithm` {string}
- `key` {string | Buffer | TypedArray | DataView}
- `iv` {string | Buffer | TypedArray | DataView}
- `options` {string}
- `options` {object} combined [OpenSSL options][] and [`stream.transform` options][]

Creates and returns a `Decipher` object that uses the given `algorithm`, `key`
and initialization vector (`iv`). Optional `options` argument controls stream behavior via [OpenSSL Options](#openssl-options).
and initialization vector (`iv`). Optional `options` argument controls stream
behavior.

The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
recent OpenSSL releases, `openssl list-cipher-algorithms` will display the
Expand Down Expand Up @@ -1337,15 +1338,16 @@ predefined curve specified by the `curveName` string. Use
OpenSSL releases, `openssl ecparam -list_curves` will also display the name
and description of each available elliptic curve.

### crypto.createHash(algorithm, options)
### crypto.createHash(algorithm[, options])
<!-- YAML
added: v0.1.92
-->
- `algorithm` {string}
- `options` {string}
- `options` {object} combined [OpenSSL options][] and [`stream.transform` options][]

Creates and returns a `Hash` object that can be used to generate hash digests
using the given `algorithm`. Optional `options` argument controls stream behavior via [OpenSSL Options](#openssl-options).
using the given `algorithm`. Optional `options` argument controls stream
behavior.

The `algorithm` is dependent on the available algorithms supported by the
version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
Expand All @@ -1372,15 +1374,16 @@ input.on('readable', () => {
});
```

### crypto.createHmac(algorithm, key, options)
### crypto.createHmac(algorithm, key[, options])
<!-- YAML
added: v0.1.94
-->
- `algorithm` {string}
- `key` {string | Buffer | TypedArray | DataView}
- `options` {string}
- `options` {object} combined [OpenSSL options][] and [`stream.transform` options][]

Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. Optional `options` argument controls stream behavior via [OpenSSL Options](#openssl-options).
Creates and returns an `Hmac` object that uses the given `algorithm` and `key`.
Optional `options` argument controls stream behavior.

The `algorithm` is dependent on the available algorithms supported by the
version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
Expand Down Expand Up @@ -1409,27 +1412,27 @@ input.on('readable', () => {
});
```

### crypto.createSign(algorithm, options)
### crypto.createSign(algorithm[, options])
<!-- YAML
added: v0.1.92
-->
- `algorithm` {string}
- `options` {string}
- `options` {object} combined [OpenSSL options][] and [`stream.transform` options][]

Creates and returns a `Sign` object that uses the given `algorithm`.
Use [`crypto.getHashes()`][] to obtain an array of names of the available
signing algorithms. Optional `options` argument controls stream behavior via [OpenSSL Options](#openssl-options).
signing algorithms. Optional `options` argument controls stream behavior.

### crypto.createVerify(algorithm, options)
### crypto.createVerify(algorithm[, options])
<!-- YAML
added: v0.1.92
-->
- `algorithm` {string}
- `options` {string}
- `options` {object} combined [OpenSSL options][] and [`stream.transform` options][]

Creates and returns a `Verify` object that uses the given algorithm.
Use [`crypto.getHashes()`][] to obtain an array of names of the available
signing algorithms. Optional `options` argument controls stream behavior via [OpenSSL Options](#openssl-options).
signing algorithms. Optional `options` argument controls stream behavior.

### crypto.getCiphers()
<!-- YAML
Expand Down Expand Up @@ -2255,3 +2258,5 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
[initialization vector]: https://en.wikipedia.org/wiki/Initialization_vector
[stream-writable-write]: stream.html#stream_writable_write_chunk_encoding_callback
[stream]: stream.html
[OpenSSL options]: #openssl-options
[`stream.transform` options]: stream.html#stream_new_stream_transform_options
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you sort the references ASCIIbetically? See the references that are already there.