Nix 2.93.3
Lix: A modern, delicious implementation of the Nix 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

 DECLARE_CMP (ValidPathInfo)
std::string fingerprint (const Store &store) const
void sign (const Store &store, const SecretKey &secretKey)
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 (const ValidPathInfo &other)=default
 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)
 DECLARE_CMP (UnkeyedValidPathInfo)

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()

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.

The documentation for this struct was generated from the following files: