20 #include <ripple/app/misc/ValidatorKeys.h>
22 #include <ripple/app/misc/Manifest.h>
23 #include <ripple/basics/Log.h>
24 #include <ripple/basics/base64.h>
25 #include <ripple/core/Config.h>
26 #include <ripple/core/ConfigSections.h>
31 if (config.
exists(SECTION_VALIDATOR_TOKEN) &&
32 config.
exists(SECTION_VALIDATION_SEED))
35 JLOG(j.
fatal()) <<
"Cannot specify both [" SECTION_VALIDATION_SEED
36 "] and [" SECTION_VALIDATOR_TOKEN
"]";
40 if (config.
exists(SECTION_VALIDATOR_TOKEN))
50 if (!m || pk != m->signingKey)
54 <<
"Invalid token specified in [" SECTION_VALIDATOR_TOKEN
64 manifest = std::move(token->manifest);
71 <<
"Invalid token specified in [" SECTION_VALIDATOR_TOKEN
"]";
74 else if (config.
exists(SECTION_VALIDATION_SEED))
76 auto const seed = parseBase58<Seed>(
82 <<
"Invalid seed specified in [" SECTION_VALIDATION_SEED
"]";
NodeID calcNodeID(PublicKey const &pk)
Calculate the 160-bit node ID from a node public key.
std::optional< ValidatorToken > loadValidatorToken(std::vector< std::string > const &blob, beast::Journal journal)
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
std::string base64_decode(std::string const &data)
std::vector< std::string > const & lines() const
Returns all the lines in the section.
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
A generic endpoint for log messages.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
ValidatorKeys(Config const &config, beast::Journal j)
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
PublicKey masterPublicKey
Section & section(std::string const &name)
Returns the section with the given name.