1#include <xrpl/protocol/STValidation.h>
3#include <xrpl/basics/Blob.h>
4#include <xrpl/basics/Log.h>
5#include <xrpl/basics/Slice.h>
6#include <xrpl/basics/base_uint.h>
7#include <xrpl/basics/chrono.h>
8#include <xrpl/beast/utility/instrumentation.h>
9#include <xrpl/protocol/HashPrefix.h>
10#include <xrpl/protocol/KeyType.h>
11#include <xrpl/protocol/PublicKey.h>
12#include <xrpl/protocol/SField.h>
13#include <xrpl/protocol/SOTemplate.h>
14#include <xrpl/protocol/STBase.h>
15#include <xrpl/protocol/STObject.h>
16#include <xrpl/protocol/Serializer.h>
33 return emplace(n, buf, std::move(*
this));
111 "xrpl::STValidation::isValid : valid key type");
115 auto reportUncheckable = [
this](
char const* reason)
noexcept {
119 <<
"Cannot check the signature of the validation for ledger " <<
getLedgerHash()
141 reportUncheckable(e.
what());
146 reportUncheckable(
"unknown exception");
std::chrono::time_point< NetClock > time_point
std::chrono::duration< rep, period > duration
Defines the fields and their attributes within a STObject.
A type which can be exported to a well known binary format.
static STBase * emplace(std::size_t n, void *buf, T &&val)
Blob getFieldVL(SField const &field) const
UInt256 getFieldH256(SField const &field) const
UInt256 getSigningHash(HashPrefix prefix) const
std::uint32_t getFieldU32(SField const &field) const
void add(Serializer &s) const override
std::uint32_t getFlags() const
NetClock::time_point getSignTime() const
static SOTemplate const & validationFormat()
STBase * move(std::size_t n, void *buf) override
Blob getSignature() const
NetClock::time_point getSeenTime() const noexcept
std::optional< bool > valid_
UInt256 getSigningHash() const
STBase * copy(std::size_t n, void *buf) const override
UInt256 getConsensusHash() const
bool isValid() const noexcept
Whether this validation carries a good signature.
bool isFull() const noexcept
PublicKey const & getSignerPublic() const noexcept
Blob getSerialized() const
NetClock::time_point seenTime_
UInt256 getLedgerHash() const
Blob const & peekData() const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool verifyDigest(PublicKey const &publicKey, UInt256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
beast::Journal debugLog()
Returns a debug journal.
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Slice makeSlice(std::array< T, N > const &a)
constexpr std::uint32_t kVfFullValidation
constexpr std::uint32_t kVfFullyCanonicalSig
@ Validation
validation for signing
std::vector< unsigned char > Blob
Storage for linear binary data.