diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 2fd160dd4..a612deb3e 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1585,20 +1585,6 @@ void LocalStore::addSignatures(const StorePath & storePath, const StringSet & si } -void LocalStore::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); - } -} - - std::optional> LocalStore::queryRealisationCore_( LocalStore::State & state, const DrvOutput & id) diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 07d9cec0a..680318d43 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -396,12 +396,6 @@ private: bool isValidPath_(State & state, const StorePath & path); void queryReferrers(State & state, const StorePath & path, StorePathSet & referrers); - /** - * Add signatures to a ValidPathInfo or Realisation using the secret keys - * specified by the ‘secret-key-files’ option. - */ - void signPathInfo(ValidPathInfo & info); - void addBuildLog(const StorePath & drvPath, std::string_view log) override; friend struct LocalDerivationGoal; diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index e99e96aac..172c82324 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -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. diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 83ca8344b..1ae4ac064 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -622,6 +622,12 @@ public: virtual void addSignatures(const StorePath & storePath, const StringSet & sigs) { unsupported("addSignatures"); } + /** + * Add signatures to a ValidPathInfo or Realisation using the secret keys + * specified by the ‘secret-key-files’ option. + */ + void signPathInfo(ValidPathInfo & info); + void signRealisation(Realisation &); /* Utility functions. */