diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-03-04T16·08+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-03-04T16·45+0100 |
commit | af7cdb1096dd12f0ca06d78f5e5a3f5e9f57b3a8 (patch) | |
tree | 1b8ff00a1183f12cd5d8f8b8ea445ec7d34c1d72 /src/libstore/crypto.hh | |
parent | 42bc395b63260e13f42e4bf348823799e78e445f (diff) |
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.
Diffstat (limited to 'src/libstore/crypto.hh')
-rw-r--r-- | src/libstore/crypto.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstore/crypto.hh b/src/libstore/crypto.hh index a1489e753649..33b79cb2e8fe 100644 --- a/src/libstore/crypto.hh +++ b/src/libstore/crypto.hh @@ -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; |