20 #ifndef RIPPLE_PROTOCOL_PUBLICKEY_H_INCLUDED
21 #define RIPPLE_PROTOCOL_PUBLICKEY_H_INCLUDED
23 #include <ripple/basics/Slice.h>
24 #include <ripple/protocol/KeyType.h>
25 #include <ripple/protocol/STExchange.h>
26 #include <ripple/protocol/UintTypes.h>
27 #include <ripple/protocol/tokens.h>
28 #include <boost/optional.hpp>
156 template <
class Hasher>
179 return std::make_unique<STBlob>(f, t.
data(), t.
size());
192 boost::optional<PublicKey>
222 boost::optional<ECDSACanonicality>
231 boost::optional<KeyType>
234 inline boost::optional<KeyType>
244 PublicKey
const& publicKey,
247 bool mustBeFullyCanonical =
true);
255 PublicKey
const& publicKey,
258 bool mustBeFullyCanonical =
true);
std::uint8_t const * data() const noexcept
std::uint8_t const * data() const
std::string base58EncodeToken(TokenType type, void const *token, std::size_t size)
NodeID calcNodeID(PublicKey const &pk)
Calculate the 160-bit node ID from a node public key.
base_uint< 160, detail::NodeIDTag > NodeID
NodeID is a 160-bit hash representing one node.
boost::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
An immutable linear range of bytes.
static void get(boost::optional< value_type > &t, STBlob const &u)
bool empty() const noexcept
const_iterator cend() const noexcept
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Slice slice() const noexcept
std::ostream & operator<<(std::ostream &os, TOffer< TIn, TOut > const &offer)
bool operator==(Manifest const &lhs, Manifest const &rhs)
static Hasher::result_type digest(void const *data, std::size_t size) noexcept
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical)
Verify a signature on a message.
static std::unique_ptr< STBlob > set(SField const &f, PublicKey const &t)
std::uint8_t const * const_iterator
std::size_t size() const noexcept
T lexicographical_compare(T... args)
AccountID calcAccountID(PublicKey const &pk)
Convert between serialized type U and C++ type T.
boost::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determine whether a signature is canonical.
PublicKey & operator=(PublicKey const &other)
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical)
Verify a secp256k1 signature on the digest of a message.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const_iterator begin() const noexcept
void hash_append(Hasher &h, Slice const &v)
const_iterator end() const noexcept
bool operator<(base_uint< Bits, Tag > const &a, base_uint< Bits, Tag > const &b)
const_iterator cbegin() const noexcept
boost::optional< AccountID > parseBase58(std::string const &s)
Parse AccountID from checked, base58 string.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.