From af7cdb1096dd12f0ca06d78f5e5a3f5e9f57b3a8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 4 Mar 2016 17:08:30 +0100 Subject: 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. --- src/libstore/binary-cache-store.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/libstore/binary-cache-store.cc') diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 01d937f2e56a..5ded16d028b0 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -14,16 +14,13 @@ namespace nix { BinaryCacheStore::BinaryCacheStore(std::shared_ptr localStore, - const Path & secretKeyFile, const Path & publicKeyFile) + const Path & secretKeyFile) : localStore(localStore) { - if (secretKeyFile != "") + if (secretKeyFile != "") { secretKey = std::unique_ptr(new SecretKey(readFile(secretKeyFile))); - - if (publicKeyFile != "") { publicKeys = std::unique_ptr(new PublicKeys); - auto key = PublicKey(readFile(publicKeyFile)); - publicKeys->emplace(key.name, key); + publicKeys->emplace(secretKey->name, secretKey->toPublicKey()); } StringSink sink; -- cgit 1.4.1