Skip to content

Commit 8b7c057

Browse files
tniessenjuanarbol
authored andcommitted
doc: guide towards x509.fingerprint256
Recommend using x509.fingerprint256 instead of x509.fingerprint and x509.fingerprint512 and suggest using it instead of x509.serialNumber in order to uniquely identify certificates. PR-URL: #42516 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tierney Cyren <[email protected]>
1 parent d2ebe2b commit 8b7c057

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/api/crypto.md

+15
Original file line numberDiff line numberDiff line change
@@ -2617,6 +2617,10 @@ added: v15.6.0
26172617

26182618
The SHA-1 fingerprint of this certificate.
26192619

2620+
Because SHA-1 is cryptographically broken and because the security of SHA-1 is
2621+
significantly worse than that of algorithms that are commonly used to sign
2622+
certificates, consider using [`x509.fingerprint256`][] instead.
2623+
26202624
### `x509.fingerprint256`
26212625

26222626
<!-- YAML
@@ -2637,6 +2641,12 @@ added: v17.2.0
26372641

26382642
The SHA-512 fingerprint of this certificate.
26392643

2644+
Because computing the SHA-256 fingerprint is usually faster and because it is
2645+
only half the size of the SHA-512 fingerprint, [`x509.fingerprint256`][] may be
2646+
a better choice. While SHA-512 presumably provides a higher level of security in
2647+
general, the security of SHA-256 matches that of most algorithms that are
2648+
commonly used to sign certificates.
2649+
26402650
### `x509.infoAccess`
26412651

26422652
<!-- YAML
@@ -2724,6 +2734,10 @@ added: v15.6.0
27242734

27252735
The serial number of this certificate.
27262736

2737+
Serial numbers are assigned by certificate authorities and do not uniquely
2738+
identify certificates. Consider using [`x509.fingerprint256`][] as a unique
2739+
identifier instead.
2740+
27272741
### `x509.subject`
27282742

27292743
<!-- YAML
@@ -6056,6 +6070,7 @@ See the [list of SSL OP Flags][] for details.
60566070
[`util.promisify()`]: util.md#utilpromisifyoriginal
60576071
[`verify.update()`]: #verifyupdatedata-inputencoding
60586072
[`verify.verify()`]: #verifyverifyobject-signature-signatureencoding
6073+
[`x509.fingerprint256`]: #x509fingerprint256
60596074
[caveats when using strings as inputs to cryptographic APIs]: #using-strings-as-inputs-to-cryptographic-apis
60606075
[certificate object]: tls.md#certificate-object
60616076
[encoding]: buffer.md#buffers-and-character-encodings

0 commit comments

Comments
 (0)