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

add note about nuget checksums #277

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions PURL-TYPES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,28 @@ nuget

pkg:nuget/[email protected]

``checksum`` qualifier
^^^^^^^^^^^^^^^^^^^^^^

``.nupkg`` files have attached signatures:
inside the package file, there is a signature file which signs the package content.
Not only can NuGet authors sign packages,
but NuGet repositories often sign every package within the repository.
NuGet.org applies repository signatures,
so it is very common for a ``.nupkg`` file to contain a repository signature.

The NuGet tooling does not consider this signature file to be part of the package.
When the NuGet tooling generates an SHA-512 hash of a package,
e.g. in a ``project.assets.json`` file or ``packages.lock.json`` file,
that SHA-512 package hash is the hash of the ``.nupkg`` file with the ``signature.p7s`` removed.
This allows additional signatures to be added to the package after it has been published,
without creating a distinct package that would be rejected by an existing ``packages.lock.json`` file.

When generating a ``checksum`` qualifier for a NuGet dependency,
NuGet's package SHA-512 should not be used.
Instead, use the SHA-512 hash of the package file.
This maintains a consistent meaning of the ``checksum`` qualifier across different package types.

qpkg
----
``qpkg`` for QNX packages:
Expand Down