PrivMX Endpoint v2.7.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 <string>
16#include <memory>
17#include <privmx/endpoint/core/Buffer.hpp>
18
19
20namespace privmx {
21namespace crypto {
22 class ExtKey;
23} //crypto
24
25namespace endpoint {
26namespace crypto {
30class ExtKey
31{
32public:
38 static ExtKey fromSeed(const core::Buffer& seed);
45 static ExtKey fromBase58(const std::string& base58);
59 ExtKey(const privmx::crypto::ExtKey& impl);
60
68 ExtKey derive(uint32_t index) const;
69
77 ExtKey deriveHardened(uint32_t index) const;
78
84 std::string getPrivatePartAsBase58() const;
85
91 std::string getPublicPartAsBase58() const;
92
98 std::string getPrivateKey() const;
99
105 std::string getPublicKey() const;
106
113
119 std::string getPublicKeyAsBase58Address() const;
120
127
135 bool verifyCompactSignatureWithHash(const core::Buffer& message, const core::Buffer& signature) const;
141 bool isPrivate() const;
142
143private:
144 std::shared_ptr<privmx::crypto::ExtKey> _impl;
145};
146
147} // crypto
148} // endpoint
149} // privmx
150
151#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