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 <cstdint>
9#include <optional>
10#include <string>
11
12namespace xrpl {
13
14class Config;
15
21{
22public:
23 // Group all keys in a struct. Either all keys are valid or none are.
24 struct Keys
25 {
29
30 Keys() = delete;
31 Keys(PublicKey const& masterPublic, PublicKey const& pub, SecretKey const& secret)
32 : masterPublicKey(masterPublic), publicKey(pub), secretKey(secret)
33 {
34 }
35 };
36
37 // Note: The existence of keys cannot be used as a proxy for checking the
38 // validity of a configuration. It is possible to have a valid
39 // configuration while not setting the keys, as per the constructor of
40 // the ValidatorKeys class.
45
46 ValidatorKeys() = delete;
47 ValidatorKeys(Config const& config, beast::Journal j);
48
49 [[nodiscard]] bool
51 {
52 return configInvalid_;
53 }
54
55private:
56 bool configInvalid_ = false; //< Set to true if config was invalid
57};
58
59} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
A public key.
Definition PublicKey.h:53
A secret key.
Definition SecretKey.h:24
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:47
Keys(PublicKey const &masterPublic, PublicKey const &pub, SecretKey const &secret)