Bitcoin ABC 0.26.3
P2P Digital Currency
|
Go to the source code of this file.
Enumerations | |
enum class | MessageVerificationResult { ERR_INVALID_ADDRESS , ERR_ADDRESS_NO_KEY , ERR_MALFORMED_SIGNATURE , ERR_PUBKEY_NOT_RECOVERED , ERR_NOT_SIGNED , OK } |
The result of a signed message verification. More... | |
enum class | SigningResult { OK , PRIVATE_KEY_NOT_AVAILABLE , SIGNING_FAILED } |
Functions | |
MessageVerificationResult | MessageVerify (const CChainParams ¶ms, const std::string &address, const std::string &signature, const std::string &message) |
Verify a signed message. | |
bool | MessageSign (const CKey &privkey, const std::string &message, std::string &signature) |
Sign a message. | |
uint256 | MessageHash (const std::string &message) |
Hashes a message for signing and verification in a manner that prevents inadvertently signing a transaction. | |
std::string | SigningResultString (const SigningResult res) |
Variables | |
const std::string | MESSAGE_MAGIC |
Text used to signify that a signed message follows and to prevent inadvertently signing a transaction. | |
|
strong |
The result of a signed message verification.
Message verification takes as an input:
|
strong |
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 67 of file message.cpp.
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 54 of file message.cpp.
MessageVerificationResult MessageVerify | ( | const CChainParams & | params, |
const std::string & | address, | ||
const std::string & | signature, | ||
const std::string & | message | ||
) |
Verify a signed message.
[in] | params | Chain params to be used to interpret the address. |
[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 74 of file message.cpp.
|
extern |
Text used to signify that a signed message follows and to prevent inadvertently signing a transaction.
Definition at line 22 of file message.cpp.