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

@ -15,19 +15,31 @@ struct Key
<name>:<key-in-base64>. */
Key(const std::string & s);
protected:
Key(const std::string & name, const std::string & key)
: name(name), key(key) { }
};
struct PublicKey;
struct SecretKey : Key
{
SecretKey(const std::string & s);
/* Return a detached signature of the given string. */
std::string signDetached(const std::string & s) const;
PublicKey toPublicKey() const;
};
struct PublicKey : Key
{
PublicKey(const std::string & data);
private:
PublicKey(const std::string & name, const std::string & key)
: Key(name, key) { }
friend class SecretKey;
};
typedef std::map<std::string, PublicKey> PublicKeys;