1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Move signPathInfo to Store

Motivation is the same for moving `signRealisation` in
db8439c328.
This commit is contained in:
John Ericson 2025-03-14 13:15:58 -04:00
parent 1bff2aeec0
commit d572533774
4 changed files with 21 additions and 20 deletions

View file

@ -1274,6 +1274,21 @@ Derivation Store::readDerivation(const StorePath & drvPath)
Derivation Store::readInvalidDerivation(const StorePath & drvPath)
{ return readDerivationCommon(*this, drvPath, false); }
void Store::signPathInfo(ValidPathInfo & info)
{
// FIXME: keep secret keys in memory.
auto secretKeyFiles = settings.secretKeyFiles;
for (auto & secretKeyFile : secretKeyFiles.get()) {
SecretKey secretKey(readFile(secretKeyFile));
LocalSigner signer(std::move(secretKey));
info.sign(*this, signer);
}
}
void Store::signRealisation(Realisation & realisation)
{
// FIXME: keep secret keys in memory.