rippled
Loading...
Searching...
No Matches
ValidatorKeys.h
1#ifndef XRPL_APP_MISC_VALIDATOR_KEYS_H_INCLUDED
2#define XRPL_APP_MISC_VALIDATOR_KEYS_H_INCLUDED
3
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/protocol/PublicKey.h>
6#include <xrpl/protocol/SecretKey.h>
7#include <xrpl/protocol/UintTypes.h>
8
9#include <string>
10
11namespace ripple {
12
13class Config;
14
19{
20public:
21 // Group all keys in a struct. Either all keys are valid or none are.
22 struct Keys
23 {
27
28 Keys() = delete;
30 PublicKey const& masterPublic_,
31 PublicKey const& public_,
32 SecretKey const& secret_)
33 : masterPublicKey(masterPublic_)
34 , publicKey(public_)
35 , secretKey(secret_)
36 {
37 }
38 };
39
40 // Note: The existence of keys cannot be used as a proxy for checking the
41 // validity of a configuration. It is possible to have a valid
42 // configuration while not setting the keys, as per the constructor of
43 // the ValidatorKeys class.
48
49 ValidatorKeys() = delete;
50 ValidatorKeys(Config const& config, beast::Journal j);
51
52 bool
54 {
55 return configInvalid_;
56 }
57
58private:
59 bool configInvalid_ = false; //< Set to true if config was invalid
60};
61
62} // namespace ripple
63
64#endif
A generic endpoint for log messages.
Definition Journal.h:41
A public key.
Definition PublicKey.h:43
A secret key.
Definition SecretKey.h:19
Validator keys and manifest as set in configuration file.
bool configInvalid() const
std::optional< Keys > keys
std::uint32_t sequence
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Keys(PublicKey const &masterPublic_, PublicKey const &public_, SecretKey const &secret_)