mirror of
https://github.com/monero-project/monero.git
synced 2025-12-15 23:53:56 -05:00
Merge pull request #1309
c441a61 wallet2_api: API to sign and verify a message (moneromooo-monero)
This commit is contained in:
commit
56c594a8fe
3 changed files with 35 additions and 0 deletions
|
|
@ -752,6 +752,23 @@ std::string WalletImpl::getTxKey(const std::string &txid) const
|
|||
}
|
||||
}
|
||||
|
||||
std::string WalletImpl::signMessage(const std::string &message)
|
||||
{
|
||||
return m_wallet->sign(message);
|
||||
}
|
||||
|
||||
bool WalletImpl::verifySignedMessage(const std::string &message, const std::string &address, const std::string &signature) const
|
||||
{
|
||||
cryptonote::account_public_address addr;
|
||||
bool has_payment_id;
|
||||
crypto::hash8 payment_id;
|
||||
|
||||
if (!cryptonote::get_account_integrated_address_from_str(addr, has_payment_id, payment_id, m_wallet->testnet(), address))
|
||||
return false;
|
||||
|
||||
return m_wallet->verify(message, addr, signature);
|
||||
}
|
||||
|
||||
bool WalletImpl::connectToDaemon()
|
||||
{
|
||||
bool result = m_wallet->check_connection();
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@ public:
|
|||
virtual std::string getUserNote(const std::string &txid) const;
|
||||
virtual std::string getTxKey(const std::string &txid) const;
|
||||
|
||||
virtual std::string signMessage(const std::string &message);
|
||||
virtual bool verifySignedMessage(const std::string &message, const std::string &address, const std::string &signature) const;
|
||||
|
||||
private:
|
||||
void clearStatus();
|
||||
void refreshThreadFunc();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue