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

BinaryCacheStore: Remove publicKeyFile argument

The public key can be derived from the secret key, so there's no need
for the user to supply it separately.
This commit is contained in:
Eelco Dolstra 2016-03-04 17:08:30 +01:00
parent 42bc395b63
commit af7cdb1096
7 changed files with 39 additions and 25 deletions

View file

@ -14,16 +14,13 @@
namespace nix {
BinaryCacheStore::BinaryCacheStore(std::shared_ptr<Store> localStore,
const Path & secretKeyFile, const Path & publicKeyFile)
const Path & secretKeyFile)
: localStore(localStore)
{
if (secretKeyFile != "")
if (secretKeyFile != "") {
secretKey = std::unique_ptr<SecretKey>(new SecretKey(readFile(secretKeyFile)));
if (publicKeyFile != "") {
publicKeys = std::unique_ptr<PublicKeys>(new PublicKeys);
auto key = PublicKey(readFile(publicKeyFile));
publicKeys->emplace(key.name, key);
publicKeys->emplace(secretKey->name, secretKey->toPublicKey());
}
StringSink sink;