![]() |
Bitcoin Core 22.99.0
P2P Digital Currency
|
#include <hash.h>#include <key.h>#include <key_io.h>#include <pubkey.h>#include <script/standard.h>#include <serialize.h>#include <util/message.h>#include <util/strencodings.h>#include <string>#include <vector>Go to the source code of this file.
Functions | |
| MessageVerificationResult | MessageVerify (const std::string &address, const std::string &signature, const std::string &message) |
| Verify a signed message. More... | |
| bool | MessageSign (const CKey &privkey, const std::string &message, std::string &signature) |
| Sign a message. More... | |
| uint256 | MessageHash (const std::string &message) |
| Hashes a message for signing and verification in a manner that prevents inadvertently signing a transaction. More... | |
| std::string | SigningResultString (const SigningResult res) |
Variables | |
| const std::string | MESSAGE_MAGIC = "Bitcoin Signed Message:\n" |
| Text used to signify that a signed message follows and to prevent inadvertently signing a transaction. More... | |
| uint256 MessageHash | ( | const std::string & | message | ) |
Hashes a message for signing and verification in a manner that prevents inadvertently signing a transaction.
Definition at line 72 of file message.cpp.
| bool MessageSign | ( | const CKey & | privkey, |
| const std::string & | message, | ||
| std::string & | signature | ||
| ) |
Sign a message.
| [in] | privkey | Private key to sign with. |
| [in] | message | The message to sign. |
| [out] | signature | Signature, base64 encoded, only set if true is returned. |
Definition at line 56 of file message.cpp.
| MessageVerificationResult MessageVerify | ( | const std::string & | address, |
| const std::string & | signature, | ||
| const std::string & | message | ||
| ) |
Verify a signed message.
| [in] | address | Signer's bitcoin address, it must refer to a public key. |
| [in] | signature | The signature in base64 format. |
| [in] | message | The message that was signed. |
Definition at line 24 of file message.cpp.
| std::string SigningResultString | ( | const SigningResult | res | ) |
Definition at line 80 of file message.cpp.
| const std::string MESSAGE_MAGIC = "Bitcoin Signed Message:\n" |
Text used to signify that a signed message follows and to prevent inadvertently signing a transaction.
Definition at line 22 of file message.cpp.