Skip to content

Commit 853f90a

Browse files
authored
Update NU3043.md with OpenSSL instructions (#3457)
1 parent 2a5722e commit 853f90a

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

docs/reference/errors-and-warnings/NU3043.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ SHA-1 is considered insecure and should no longer be used.
2424

2525
To resolve this warning, ensure that you provide a valid SHA-256, SHA-384, or SHA-512 certificate fingerprint (in hexadecimal) for the `--certificate-fingerprint` option in the `dotnet nuget sign` command or the `CertificateFingerprint` option in the `NuGet.exe sign` command.
2626

27-
Customers can use the following PowerShell script to compute SHA-2 family hashes for certificates.
28-
To use the script, customers need to save the certificate to a local folder.
27+
You can use the following scripts to compute SHA-2 family hashes for certificates.
28+
29+
### PowerShell
30+
To use the script, you need to save the certificate to a local folder.
2931

3032
```powershell
3133
$certificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new($certPath)
@@ -41,3 +43,16 @@ Finally
4143
$certificate.Dispose()
4244
}
4345
```
46+
### OpenSSL (Linux/macOS)
47+
48+
If the certificate is in PEM or CRT format:
49+
```sh
50+
openssl x509 -in path/to/certificate -outform der | sha256sum
51+
```
52+
53+
If the certificate is already in DER format:
54+
```sh
55+
sha256sum path/to/certificate
56+
```
57+
> [!TIP]
58+
> For SHA-384 or SHA-512, replace sha256sum with sha384sum or sha512sum as needed.

0 commit comments

Comments
 (0)