PrivMX Endpoint v2.8.0
Loading...
Searching...
No Matches
ExtKey.hpp
1/*
2PrivMX Endpoint.
3Copyright © 2024 Simplito sp. z o.o.
4
5This file is part of the PrivMX Platform (https://privmx.dev).
6This software is Licensed under the PrivMX Free License.
7
8See the License for the specific language governing permissions and
9limitations under the License.
10*/
11
12#ifndef _PRIVMXLIB_ENDPOINT_CRYPTO_EXTKEY_HPP_
13#define _PRIVMXLIB_ENDPOINT_CRYPTO_EXTKEY_HPP_
14
15#include <memory>
16#include <privmx/endpoint/core/Buffer.hpp>
17#include <string>
18
19namespace privmx {
20namespace crypto {
21class ExtKey;
22} // namespace crypto
23
24namespace endpoint {
25namespace crypto {
29class ExtKey {
30public:
36 static ExtKey fromSeed(const core::Buffer& seed);
43 static ExtKey fromBase58(const std::string& base58);
57 ExtKey(const privmx::crypto::ExtKey& impl);
58
66 ExtKey derive(uint32_t index) const;
67
75 ExtKey deriveHardened(uint32_t index) const;
76
82 std::string getPrivatePartAsBase58() const;
83
89 std::string getPublicPartAsBase58() const;
90
96 std::string getPrivateKey() const;
97
103 std::string getPublicKey() const;
104
111
117 std::string getPublicKeyAsBase58Address() const;
118
125
133 bool verifyCompactSignatureWithHash(const core::Buffer& message, const core::Buffer& signature) const;
139 bool isPrivate() const;
140
141private:
142 std::shared_ptr<privmx::crypto::ExtKey> _impl;
143};
144
145} // namespace crypto
146} // namespace endpoint
147} // namespace privmx
148
149#endif // _PRIVMXLIB_ENDPOINT_CRYPTO_EXTKEY_HPP_
Definition Buffer.hpp:13
ExtKey deriveHardened(uint32_t index) const
std::string getPublicKeyAsBase58Address() const
ExtKey derive(uint32_t index) const
static ExtKey fromSeed(const core::Buffer &seed)
bool verifyCompactSignatureWithHash(const core::Buffer &message, const core::Buffer &signature) const
Validates a signature of a message.
static ExtKey fromBase58(const std::string &base58)
ExtKey(const privmx::crypto::ExtKey &impl)
std::string getPrivateKey() const
core::Buffer getPrivateEncKey() const
std::string getPrivatePartAsBase58() const
core::Buffer getChainCode() const
Gets the chain code of Extended Key.
std::string getPublicPartAsBase58() const
std::string getPublicKey() const