xrpld
Loading...
Searching...
No Matches
ValidatorKeys.h
1#pragma once
2
3#include <xrpl/beast/utility/Journal.h>
4#include <xrpl/protocol/PublicKey.h>
5#include <xrpl/protocol/SecretKey.h>
6#include <xrpl/protocol/UintTypes.h>
7
8#include <string>
9
10namespace xrpl {
11
12class Config;
13
18{
19public:
20 // Group all keys in a struct. Either all keys are valid or none are.
21 struct Keys
22 {
26
27 Keys() = delete;
28 Keys(PublicKey const& masterPublic, PublicKey const& pub, SecretKey const& secret)
29 : masterPublicKey(masterPublic), publicKey(pub), secretKey(secret)
30 {
31 }
32 };
33
34 // Note: The existence of keys cannot be used as a proxy for checking the
35 // validity of a configuration. It is possible to have a valid
36 // configuration while not setting the keys, as per the constructor of
37 // the ValidatorKeys class.
42
43 ValidatorKeys() = delete;
44 ValidatorKeys(Config const& config, beast::Journal j);
45
46 [[nodiscard]] bool
48 {
49 return configInvalid_;
50 }
51
52private:
53 bool configInvalid_ = false; //< Set to true if config was invalid
54};
55
56} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:38
A public key.
Definition PublicKey.h:42
A secret key.
Definition SecretKey.h:18
bool configInvalid() const
std::uint32_t sequence
std::optional< Keys > keys
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
BaseUInt< 160, detail::NodeIDTag > NodeID
NodeID is a 160-bit hash representing one node.
Definition UintTypes.h:39
Keys(PublicKey const &masterPublic, PublicKey const &pub, SecretKey const &secret)