Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

CMessageSigner Class Reference

Helper class for signing messages and checking their signatures. More...

#include <messagesigner.h>

Static Public Member Functions

static bool GetKeysFromSecret (const std::string &strSecret, CKey &keyRet, CPubKey &pubkeyRet)
 Set the private/public key values, returns true if successful. More...
 
static bool SignMessage (const std::string &strMessage, std::vector< unsigned char > &vchSigRet, const CKey &key)
 Sign the message, returns true if successful. More...
 
static bool VerifyMessage (const CPubKey &pubkey, const std::vector< unsigned char > &vchSig, const std::string &strMessage, std::string &strErrorRet)
 Verify the message signature, returns true if succcessful. More...
 
static bool VerifyMessage (const CKeyID &keyID, const std::vector< unsigned char > &vchSig, const std::string &strMessage, std::string &strErrorRet)
 Verify the message signature, returns true if succcessful. More...
 

Detailed Description

Helper class for signing messages and checking their signatures.

Definition at line 12 of file messagesigner.h.

Member Function Documentation

◆ GetKeysFromSecret()

bool CMessageSigner::GetKeysFromSecret ( const std::string &  strSecret,
CKey keyRet,
CPubKey pubkeyRet 
)
static

Set the private/public key values, returns true if successful.

Definition at line 12 of file messagesigner.cpp.

References CBitcoinSecret::GetKey(), CKey::GetPubKey(), and CBitcoinSecret::SetString().

Referenced by CSporkManager::SetPrivKey().

◆ SignMessage()

bool CMessageSigner::SignMessage ( const std::string &  strMessage,
std::vector< unsigned char > &  vchSigRet,
const CKey key 
)
static

Sign the message, returns true if successful.

Definition at line 24 of file messagesigner.cpp.

References CHashWriter::GetHash(), SER_GETHASH, CHashSigner::SignHash(), and strMessageMagic.

Referenced by CGovernanceVote::Sign(), and CSporkMessage::Sign().

◆ VerifyMessage() [1/2]

bool CMessageSigner::VerifyMessage ( const CPubKey pubkey,
const std::vector< unsigned char > &  vchSig,
const std::string &  strMessage,
std::string &  strErrorRet 
)
static

Verify the message signature, returns true if succcessful.

Definition at line 33 of file messagesigner.cpp.

References CPubKey::GetID().

Referenced by CGovernanceVote::CheckSignature(), CSporkMessage::CheckSignature(), CheckStringSig(), CGovernanceVote::Sign(), and CSporkMessage::Sign().

◆ VerifyMessage() [2/2]

bool CMessageSigner::VerifyMessage ( const CKeyID keyID,
const std::vector< unsigned char > &  vchSig,
const std::string &  strMessage,
std::string &  strErrorRet 
)
static

Verify the message signature, returns true if succcessful.

Definition at line 38 of file messagesigner.cpp.

References CHashWriter::GetHash(), SER_GETHASH, strMessageMagic, and CHashSigner::VerifyHash().


The documentation for this class was generated from the following files:
Released under the MIT license