rippled
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& public_, SecretKey const& secret_)
29 : masterPublicKey(masterPublic_), publicKey(public_), 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 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:40
A public key.
Definition PublicKey.h:42
A secret key.
Definition SecretKey.h:18
Validator keys and manifest as set in configuration file.
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
Keys(PublicKey const &masterPublic_, PublicKey const &public_, SecretKey const &secret_)