File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2647,7 +2647,23 @@ added: v15.6.0
2647
2647
* ` otherCert ` {X509Certificate}
2648
2648
* Returns: {boolean}
2649
2649
2650
- Checks whether this certificate was issued by the given ` otherCert ` .
2650
+ Checks whether this certificate was potentially issued by the given ` otherCert `
2651
+ by comparing the certificate metadata.
2652
+
2653
+ This is useful for pruning a list of possible issuer certificates which have been
2654
+ selected using a more rudimentary filtering routine, i.e. just based on subject
2655
+ and issuer names.
2656
+
2657
+ Finally, to verify that this certificate's signature was produced by a private key
2658
+ corresponding to ` otherCert ` 's public key use [ ` x509.verify(publicKey) ` ] [ ]
2659
+ with ` otherCert ` 's public key represented as a [ ` KeyObject ` ] [ ]
2660
+ like so
2661
+
2662
+ ``` js
2663
+ if (! x509 .verify (otherCert .publicKey )) {
2664
+ throw new Error (' otherCert did not issue x509' );
2665
+ }
2666
+ ```
2651
2667
2652
2668
### ` x509.checkPrivateKey(privateKey) `
2653
2669
@@ -6187,6 +6203,7 @@ See the [list of SSL OP Flags][] for details.
6187
6203
[ `verify.update()` ] : #verifyupdatedata-inputencoding
6188
6204
[ `verify.verify()` ] : #verifyverifyobject-signature-signatureencoding
6189
6205
[ `x509.fingerprint256` ] : #x509fingerprint256
6206
+ [ `x509.verify(publicKey)` ] : #x509verifypublickey
6190
6207
[ caveats when using strings as inputs to cryptographic APIs ] : #using-strings-as-inputs-to-cryptographic-apis
6191
6208
[ certificate object ] : tls.md#certificate-object
6192
6209
[ encoding ] : buffer.md#buffers-and-character-encodings
You can’t perform that action at this time.
0 commit comments