Nix 2.26.3
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 Store &store) const
 
void sign (const Store &store, const Signer &signer)
 
std::optional< ContentAddressWithReferencescontentAddressWithReferences () const
 
bool isContentAddressed (const Store &store) const
 
size_t checkSignatures (const Store &store, const PublicKeys &publicKeys) const
 
bool checkSignature (const Store &store, const PublicKeys &publicKeys, const std::string &sig) const
 
Strings shortRefs () const
 
 ValidPathInfo (StorePath &&path, UnkeyedValidPathInfo info)
 
 ValidPathInfo (const StorePath &path, UnkeyedValidPathInfo info)
 
 ValidPathInfo (const Store &store, std::string_view name, ContentAddressWithReferences &&ca, Hash narHash)
 
- Public Member Functions inherited from nix::UnkeyedValidPathInfo
 UnkeyedValidPathInfo (const UnkeyedValidPathInfo &other)=default
 
 UnkeyedValidPathInfo (Hash narHash)
 
bool operator== (const UnkeyedValidPathInfo &) const noexcept
 
std::weak_ordering operator<=> (const UnkeyedValidPathInfo &) const noexcept
 
virtual nlohmann::json toJSON (const Store &store, bool includeImpureInfo, HashFormat hashFormat) const
 

Public Attributes

StorePath path
 
- Public Attributes inherited from nix::UnkeyedValidPathInfo
std::optional< StorePathderiver
 
Hash narHash
 
StorePathSet references
 
time_t registrationTime = 0
 
uint64_t narSize = 0
 
uint64_t id = 0
 
bool ultimate = false
 
StringSet sigs
 
std::optional< ContentAddressca
 

Static Public Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from nix::UnkeyedValidPathInfo
static UnkeyedValidPathInfo fromJSON (const Store &store, const nlohmann::json &json)
 

Member Function Documentation

◆ checkSignature()

bool nix::ValidPathInfo::checkSignature ( const Store & store,
const PublicKeys & publicKeys,
const std::string & sig ) const

Verify a single signature.

◆ checkSignatures()

size_t nix::ValidPathInfo::checkSignatures ( const Store & 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 Store & 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 Store & 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: