Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::ValidPathInfo Struct Reference
Inheritance diagram for nix::ValidPathInfo:
nix::UnkeyedValidPathInfo nix::NarInfo

Public Member Functions

bool operator== (const ValidPathInfo &) const =default
auto operator<=> (const ValidPathInfo &) const =default
std::string fingerprint (const StoreDirConfig &store) const
void sign (const Store &store, const Signer &signer)
void sign (const Store &store, const std::vector< std::unique_ptr< Signer > > &signers)
std::optional< ContentAddressWithReferences > contentAddressWithReferences () const
bool isContentAddressed (const StoreDirConfig &store) const
size_t checkSignatures (const StoreDirConfig &store, const PublicKeys &publicKeys) const
bool checkSignature (const StoreDirConfig &store, const PublicKeys &publicKeys, const Signature &sig) const
Strings shortRefs () const
 ValidPathInfo (StorePath &&path, UnkeyedValidPathInfo info)
 ValidPathInfo (const StorePath &path, UnkeyedValidPathInfo info)
Public Member Functions inherited from nix::UnkeyedValidPathInfo
 UnkeyedValidPathInfo (const UnkeyedValidPathInfo &other)=default
 UnkeyedValidPathInfo (const StoreDirConfig &store, Hash narHash)
 UnkeyedValidPathInfo (std::string storeDir, Hash narHash)
bool operator== (const UnkeyedValidPathInfo &) const noexcept
std::weak_ordering operator<=> (const UnkeyedValidPathInfo &) const noexcept
virtual nlohmann::json toJSON (const StoreDirConfig *store, bool includeImpureInfo, PathInfoJsonFormat format) const

Static Public Member Functions

static ValidPathInfo makeFromCA (const StoreDirConfig &store, std::string_view name, ContentAddressWithReferences &&ca, Hash narHash)
Static Public Member Functions inherited from nix::UnkeyedValidPathInfo
static UnkeyedValidPathInfo fromJSON (const StoreDirConfig *store, const nlohmann::json &json)

Public Attributes

StorePath path
Public Attributes inherited from nix::UnkeyedValidPathInfo
std::string storeDir
std::optional< StorePath > deriver
Hash narHash
StorePathSet references
time_t registrationTime = 0
uint64_t narSize = 0
bool ultimate = false
std::set< Signature > sigs
std::optional< ContentAddress > ca

Static Public Attributes

static const size_t maxSigs = std::numeric_limits<size_t>::max()

Member Function Documentation

◆ checkSignature()

bool nix::ValidPathInfo::checkSignature ( const StoreDirConfig & store,
const PublicKeys & publicKeys,
const Signature & sig ) const

Verify a single signature.

◆ checkSignatures()

size_t nix::ValidPathInfo::checkSignatures ( const StoreDirConfig & store,
const PublicKeys & publicKeys ) const

Return the number of signatures on this .narinfo that were produced by one of the specified keys, or maxSigs if the path is content-addressed.

◆ contentAddressWithReferences()

std::optional< ContentAddressWithReferences > nix::ValidPathInfo::contentAddressWithReferences ( ) const
Returns
The ContentAddressWithReferences that determines the store path for a content-addressed store object, std::nullopt for an input-addressed store object.

◆ fingerprint()

std::string nix::ValidPathInfo::fingerprint ( const StoreDirConfig & store) const

Return a fingerprint of the store path to be used in binary cache signatures. It contains the store path, the base-32 SHA-256 hash of the NAR serialisation of the path, the size of the NAR, and the sorted references. The size field is strictly speaking superfluous, but might prevent endless/excessive data attacks.

◆ isContentAddressed()

bool nix::ValidPathInfo::isContentAddressed ( const StoreDirConfig & store) const
Returns
true iff the path is verifiably content-addressed.

◆ shortRefs()

Strings nix::ValidPathInfo::shortRefs ( ) const

References as store path basenames, including a self reference if it has one.


The documentation for this struct was generated from the following files:
  • libstore/include/nix/store/path-info.hh
  • libstore/path-info.cc