Nix
2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
crypto.hh
Go to the documentation of this file.
1
#pragma once
3
4
5
#include <map>
6
#include <string>
7
8
namespace
nix {
9
10
struct
Key
11
{
12
std::string name;
13
std::string key;
14
19
Key
(std::string_view s);
20
21
std::string to_string()
const
;
22
23
protected
:
24
Key
(std::string_view name, std::string && key)
25
: name(name), key(std::move(key)) { }
26
};
27
28
struct
PublicKey
;
29
30
struct
SecretKey :
Key
31
{
32
SecretKey(std::string_view s);
33
37
std::string
signDetached
(std::string_view s)
const
;
38
39
PublicKey
toPublicKey()
const
;
40
41
static
SecretKey generate(std::string_view name);
42
43
private
:
44
SecretKey(std::string_view name, std::string && key)
45
:
Key
(name, std::move(key)) { }
46
};
47
48
struct
PublicKey :
Key
49
{
50
PublicKey(std::string_view data);
51
52
private
:
53
PublicKey(std::string_view name, std::string && key)
54
:
Key
(name, std::move(key)) { }
55
friend
struct
SecretKey;
56
};
57
58
typedef
std::map<std::string, PublicKey> PublicKeys;
59
64
bool
verifyDetached(
const
std::string & data,
const
std::string & sig,
65
const
PublicKeys & publicKeys);
66
67
PublicKeys getDefaultPublicKeys();
68
69
}
nix::Key::Key
Key(std::string_view s)
Definition
crypto.cc:19
nix::PublicKey
Definition
crypto.hh:49
nix::SecretKey::signDetached
std::string signDetached(std::string_view s) const
Definition
crypto.cc:44
lix
libstore
crypto.hh
Generated by
1.15.0