PIVX Core  5.6.99
P2P Digital Currency
Static Public Member Functions | List of all members
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 GetKeysFromSecret (const std::string &strSecret, CKey &keyRet, CKeyID &keyIDRet)
 
static uint256 GetMessageHash (const std::string &strMessage)
 Get the hash based on the input message. 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 SignMessage (const std::string &strMessage, std::vector< unsigned char > &vchSigRet, const CBLSSecretKey &key)
 Sign the message with BLS key, 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 successful. 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 successful. More...
 
static bool VerifyMessage (const CBLSPublicKey &pk, const std::vector< unsigned char > &vchSig, const std::string &strMessage)
 Verify the message BLS signature, returns true if successful. More...
 

Detailed Description

Helper class for signing messages and checking their signatures.

Definition at line 22 of file messagesigner.h.

Member Function Documentation

◆ GetKeysFromSecret() [1/2]

bool CMessageSigner::GetKeysFromSecret ( const std::string &  strSecret,
CKey keyRet,
CKeyID keyIDRet 
)
static

Definition at line 26 of file messagesigner.cpp.

Here is the call graph for this function:

◆ GetKeysFromSecret() [2/2]

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 16 of file messagesigner.cpp.

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

◆ GetMessageHash()

uint256 CMessageSigner::GetMessageHash ( const std::string &  strMessage)
static

Get the hash based on the input message.

Definition at line 36 of file messagesigner.cpp.

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

◆ SignMessage() [1/2]

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

Sign the message with BLS key, returns true if successful.

Definition at line 49 of file messagesigner.cpp.

Here is the call graph for this function:

◆ SignMessage() [2/2]

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 44 of file messagesigner.cpp.

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

◆ VerifyMessage() [1/3]

bool CMessageSigner::VerifyMessage ( const CBLSPublicKey pk,
const std::vector< unsigned char > &  vchSig,
const std::string &  strMessage 
)
static

Verify the message BLS signature, returns true if successful.

Definition at line 64 of file messagesigner.cpp.

Here is the call graph for this function:

◆ VerifyMessage() [2/3]

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 successful.

Definition at line 59 of file messagesigner.cpp.

Here is the call graph for this function:

◆ VerifyMessage() [3/3]

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 successful.

Definition at line 54 of file messagesigner.cpp.

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

The documentation for this class was generated from the following files: