Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Functions | Variables
message.cpp File Reference
#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>
Include dependency graph for message.cpp:

Go to the source code of this file.

Functions

MessageVerificationResult MessageVerify (const CChainParams &params, 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 = "eCash Signed Message:\n"
 Text used to signify that a signed message follows and to prevent inadvertently signing a transaction.
 

Function Documentation

◆ MessageHash()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MessageSign()

bool MessageSign ( const CKey privkey,
const std::string &  message,
std::string &  signature 
)

Sign a message.

Parameters
[in]privkeyPrivate key to sign with.
[in]messageThe message to sign.
[out]signatureSignature, base64 encoded, only set if true is returned.
Returns
true if signing was successful.

Definition at line 54 of file message.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MessageVerify()

MessageVerificationResult MessageVerify ( const CChainParams params,
const std::string &  address,
const std::string &  signature,
const std::string &  message 
)

Verify a signed message.

Parameters
[in]paramsChain params to be used to interpret the address.
[in]addressSigner's bitcoin address, it must refer to a public key.
[in]signatureThe signature in base64 format.
[in]messageThe message that was signed.
Returns
result code

Definition at line 24 of file message.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SigningResultString()

std::string SigningResultString ( const SigningResult  res)

Definition at line 74 of file message.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ MESSAGE_MAGIC

const std::string MESSAGE_MAGIC = "eCash 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.