doc: fix verify in crypto.md
PR-URL: https://github.com/nodejs/node/pull/14469 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
d3e07e3667
commit
2e7ccc252e
@ -1074,7 +1074,7 @@ console.log(verify.verify(publicKey, signature));
|
|||||||
// Prints: true or false
|
// Prints: true or false
|
||||||
```
|
```
|
||||||
|
|
||||||
### verifier.update(data[, inputEncoding])
|
### verify.update(data[, inputEncoding])
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.1.92
|
added: v0.1.92
|
||||||
changes:
|
changes:
|
||||||
@ -1093,7 +1093,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.
|
This can be called many times with new data as it is streamed.
|
||||||
|
|
||||||
### verifier.verify(object, signature[, signatureFormat])
|
### verify.verify(object, signature[, signatureFormat])
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.1.92
|
added: v0.1.92
|
||||||
changes:
|
changes:
|
||||||
@ -1110,7 +1110,7 @@ The `object` argument can be either a string containing a PEM encoded object,
|
|||||||
which can be an RSA public key, a DSA public key, or an X.509 certificate,
|
which can be an RSA public key, a DSA public key, or an X.509 certificate,
|
||||||
or an object with one or more of the following properties:
|
or an object with one or more of the following properties:
|
||||||
|
|
||||||
* `key`: {string} - PEM encoded private key (required)
|
* `key`: {string} - PEM encoded public key (required)
|
||||||
* `padding`: {integer} - Optional padding value for RSA, one of the following:
|
* `padding`: {integer} - Optional padding value for RSA, one of the following:
|
||||||
* `crypto.constants.RSA_PKCS1_PADDING` (default)
|
* `crypto.constants.RSA_PKCS1_PADDING` (default)
|
||||||
* `crypto.constants.RSA_PKCS1_PSS_PADDING`
|
* `crypto.constants.RSA_PKCS1_PSS_PADDING`
|
||||||
@ -1132,7 +1132,7 @@ string; otherwise `signature` is expected to be a [`Buffer`][],
|
|||||||
Returns `true` or `false` depending on the validity of the signature for
|
Returns `true` or `false` depending on the validity of the signature for
|
||||||
the data and public key.
|
the data and public key.
|
||||||
|
|
||||||
The `verifier` object can not be used again after `verify.verify()` has been
|
The `verify` object can not be used again after `verify.verify()` has been
|
||||||
called. Multiple calls to `verify.verify()` will result in an error being
|
called. Multiple calls to `verify.verify()` will result in an error being
|
||||||
thrown.
|
thrown.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user