mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 17:29:36 +01:00
Narinfo sign: multiple signatures variant
This is a small optimization used when we're signing a narinfo for multiple keys in one go. Using this sign variant, we only compute the NAR fingerprint once, then sign it with all the keys.
This commit is contained in:
parent
e12369a68e
commit
7ea536fe84
3 changed files with 10 additions and 3 deletions
|
|
@ -40,6 +40,14 @@ void ValidPathInfo::sign(const Store & store, const Signer & signer)
|
|||
sigs.insert(signer.signDetached(fingerprint(store)));
|
||||
}
|
||||
|
||||
void ValidPathInfo::sign(const Store & store, const std::vector<std::unique_ptr<Signer>> & signers)
|
||||
{
|
||||
auto fingerprint = this->fingerprint(store);
|
||||
for (auto & signer: signers) {
|
||||
sigs.insert(signer->signDetached(fingerprint));
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<ContentAddressWithReferences> ValidPathInfo::contentAddressWithReferences() const
|
||||
{
|
||||
if (! ca)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue