Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: fixing typo's in methods syntax #40981

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
58 changes: 29 additions & 29 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ The `crypto` module provides the `Certificate` class for working with SPKAC
data. The most common usage is handling output generated by the HTML5
`<keygen>` element. Node.js uses [OpenSSL's SPKAC implementation][] internally.

### Static method: `Certificate.exportChallenge(spkac[, encoding])`
### Static method: `Certificate.exportChallenge(spkac, [encoding])`

<!-- YAML
added: v9.0.0
Expand Down Expand Up @@ -116,7 +116,7 @@ console.log(challenge.toString('utf8'));
// Prints: the challenge as a UTF8 string
```

### Static method: `Certificate.exportPublicKey(spkac[, encoding])`
### Static method: `Certificate.exportPublicKey(spkac, [encoding])`

<!-- YAML
added: v9.0.0
Expand Down Expand Up @@ -148,7 +148,7 @@ console.log(publicKey);
// Prints: the public key as <Buffer ...>
```

### Static method: `Certificate.verifySpkac(spkac[, encoding])`
### Static method: `Certificate.verifySpkac(spkac, [encoding])`

<!-- YAML
added: v9.0.0
Expand Down Expand Up @@ -209,7 +209,7 @@ const cert1 = new Certificate();
const cert2 = Certificate();
```

#### `certificate.exportChallenge(spkac[, encoding])`
#### `certificate.exportChallenge(spkac, [encoding])`

<!-- YAML
added: v0.11.8
Expand Down Expand Up @@ -238,7 +238,7 @@ console.log(challenge.toString('utf8'));
// Prints: the challenge as a UTF8 string
```

#### `certificate.exportPublicKey(spkac[, encoding])`
#### `certificate.exportPublicKey(spkac, [encoding])`

<!-- YAML
added: v0.11.8
Expand Down Expand Up @@ -267,7 +267,7 @@ console.log(publicKey);
// Prints: the public key as <Buffer ...>
```

#### `certificate.verifySpkac(spkac[, encoding])`
#### `certificate.verifySpkac(spkac, [encoding])`

<!-- YAML
added: v0.11.8
Expand Down Expand Up @@ -554,7 +554,7 @@ been completed using the [`cipher.final()`][] method.
If the `authTagLength` option was set during the `cipher` instance's creation,
this function will return exactly `authTagLength` bytes.

### `cipher.setAAD(buffer[, options])`
### `cipher.setAAD(buffer, [options])`

<!-- YAML
added: v1.0.0
Expand Down Expand Up @@ -597,7 +597,7 @@ using `0x0` instead of PKCS padding.
The `cipher.setAutoPadding()` method must be called before
[`cipher.final()`][].

### `cipher.update(data[, inputEncoding][, outputEncoding])`
### `cipher.update(data, [inputEncoding], [outputEncoding])`

<!-- YAML
added: v0.1.94
Expand Down Expand Up @@ -843,7 +843,7 @@ 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
than once will result in an error being thrown.

### `decipher.setAAD(buffer[, options])`
### `decipher.setAAD(buffer, [options])`

<!-- YAML
added: v1.0.0
Expand Down Expand Up @@ -876,7 +876,7 @@ The `decipher.setAAD()` method must be called before [`decipher.update()`][].
When passing a string as the `buffer`, please consider
[caveats when using strings as inputs to cryptographic APIs][].

### `decipher.setAuthTag(buffer[, encoding])`
### `decipher.setAuthTag(buffer, [encoding])`

<!-- YAML
added: v1.0.0
Expand Down Expand Up @@ -931,7 +931,7 @@ multiple of the ciphers block size.
The `decipher.setAutoPadding()` method must be called before
[`decipher.final()`][].

### `decipher.update(data[, inputEncoding][, outputEncoding])`
### `decipher.update(data, [inputEncoding], [outputEncoding])`

<!-- YAML
added: v0.1.94
Expand Down Expand Up @@ -1019,7 +1019,7 @@ const bobSecret = bob.computeSecret(aliceKey);
assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
```

### `diffieHellman.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])`
### `diffieHellman.computeSecret(otherPublicKey, [inputEncoding], [outputEncoding])`

<!-- YAML
added: v0.5.0
Expand Down Expand Up @@ -1108,7 +1108,7 @@ Returns the Diffie-Hellman public key in the specified `encoding`.
If `encoding` is provided a
string is returned; otherwise a [`Buffer`][] is returned.

### `diffieHellman.setPrivateKey(privateKey[, encoding])`
### `diffieHellman.setPrivateKey(privateKey, [encoding])`

<!-- YAML
added: v0.5.0
Expand All @@ -1122,7 +1122,7 @@ Sets the Diffie-Hellman private key. If the `encoding` argument is provided,
to be a string. If no `encoding` is provided, `privateKey` is expected
to be a [`Buffer`][], `TypedArray`, or `DataView`.

### `diffieHellman.setPublicKey(publicKey[, encoding])`
### `diffieHellman.setPublicKey(publicKey, [encoding])`

<!-- YAML
added: v0.5.0
Expand Down Expand Up @@ -1247,7 +1247,7 @@ assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
// OK
```

### Static method: `ECDH.convertKey(key, curve[, inputEncoding[, outputEncoding[, format]]])`
### Static method: `ECDH.convertKey(key, curve, [inputEncoding, [outputEncoding, [format]]])`

<!-- YAML
added: v10.0.0
Expand Down Expand Up @@ -1320,7 +1320,7 @@ const uncompressedKey = ECDH.convertKey(compressedKey,
console.log(uncompressedKey === ecdh.getPublicKey('hex'));
```

### `ecdh.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])`
### `ecdh.computeSecret(otherPublicKey, [inputEncoding], [outputEncoding])`

<!-- YAML
added: v0.11.14
Expand Down Expand Up @@ -1356,7 +1356,7 @@ lies outside of the elliptic curve. Since `otherPublicKey` is
usually supplied from a remote user over an insecure network,
be sure to handle this exception accordingly.

### `ecdh.generateKeys([encoding[, format]])`
### `ecdh.generateKeys([encoding, [format]])`

<!-- YAML
added: v0.11.14
Expand Down Expand Up @@ -1389,7 +1389,7 @@ added: v0.11.14
If `encoding` is specified, a string is returned; otherwise a [`Buffer`][] is
returned.

### `ecdh.getPublicKey([encoding][, format])`
### `ecdh.getPublicKey([encoding], [format])`

<!-- YAML
added: v0.11.14
Expand All @@ -1407,7 +1407,7 @@ The `format` argument specifies point encoding and can be `'compressed'` or
If `encoding` is specified, a string is returned; otherwise a [`Buffer`][] is
returned.

### `ecdh.setPrivateKey(privateKey[, encoding])`
### `ecdh.setPrivateKey(privateKey, [encoding])`

<!-- YAML
added: v0.11.14
Expand All @@ -1425,7 +1425,7 @@ 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(publicKey[, encoding])`
### `ecdh.setPublicKey(publicKey, [encoding])`

<!-- YAML
added: v0.11.14
Expand Down Expand Up @@ -1697,7 +1697,7 @@ a [`Buffer`][] is returned.
The `Hash` object can not be used again after `hash.digest()` method has been
called. Multiple calls will cause an error to be thrown.

### `hash.update(data[, inputEncoding])`
### `hash.update(data, [inputEncoding])`

<!-- YAML
added: v0.1.92
Expand Down Expand Up @@ -1857,7 +1857,7 @@ 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[, inputEncoding])`
### `hmac.update(data, [inputEncoding])`

<!-- YAML
added: v0.1.94
Expand Down Expand Up @@ -2219,7 +2219,7 @@ console.log(verify.verify(publicKey, signature));
// Prints: true
```

### `sign.sign(privateKey[, outputEncoding])`
### `sign.sign(privateKey, [outputEncoding])`

<!-- YAML
added: v0.1.92
Expand Down Expand Up @@ -2286,7 +2286,7 @@ 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[, inputEncoding])`
### `sign.update(data, [inputEncoding])`

<!-- YAML
added: v0.1.92
Expand Down Expand Up @@ -2328,7 +2328,7 @@ The [`crypto.createVerify()`][] method is used to create `Verify` instances.

See [`Sign`][] for examples.

### `verify.update(data[, inputEncoding])`
### `verify.update(data, [inputEncoding])`

<!-- YAML
added: v0.1.92
Expand All @@ -2349,7 +2349,7 @@ encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][], `TypedArray`, or

This can be called many times with new data as it is streamed.

### `verify.verify(object, signature[, signatureEncoding])`
### `verify.verify(object, signature, [signatureEncoding])`

<!-- YAML
added: v0.1.92
Expand Down Expand Up @@ -2467,7 +2467,7 @@ added: v15.6.0
* Type: {boolean} Will be `true` if this is a Certificate Authority (ca)
certificate.

### `x509.checkEmail(email[, options])`
### `x509.checkEmail(email, [options])`

<!-- YAML
added: v15.6.0
Expand All @@ -2485,7 +2485,7 @@ added: v15.6.0

Checks whether the certificate matches the given email address.

### `x509.checkHost(name[, options])`
### `x509.checkHost(name, [options])`

<!-- YAML
added: v15.6.0
Expand All @@ -2503,7 +2503,7 @@ added: v15.6.0

Checks whether the certificate matches the given host name.

### `x509.checkIP(ip[, options])`
### `x509.checkIP(ip, [options])`

<!-- YAML
added: v15.6.0
Expand Down