Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
signer.hh
1#pragma once
2
3#include "nix/util/types.hh"
5
6#include <map>
7#include <optional>
8
9namespace nix {
10
19struct Signer
20{
21private:
22 /* VTable anchor to avoid weak linkage of the vtable - it breaks
23 dynamic_cast across shared libraries on Darwin. */
24 virtual void anchor();
25
26public:
27 virtual ~Signer() = default;
28
38 virtual Signature signDetached(std::string_view data) const = 0;
39
43 virtual const PublicKey & getPublicKey() = 0;
44};
45
46using Signers = std::map<std::string, Signer *>;
47
53struct LocalSigner : Signer
54{
55 LocalSigner(SecretKey && privateKey);
56
57 Signature signDetached(std::string_view s) const override;
58
59 const PublicKey & getPublicKey() override;
60
61private:
62
63 SecretKey privateKey;
64 PublicKey publicKey;
65};
66
67} // namespace nix
Signature signDetached(std::string_view s) const override
Definition signer.cc:15
const PublicKey & getPublicKey() override
Definition signer.cc:20
Definition local-keys.hh:92
Definition local-keys.hh:72
Definition local-keys.hh:16
Definition signer.hh:20
virtual Signature signDetached(std::string_view data) const =0
virtual const PublicKey & getPublicKey()=0