6 #ifndef PIVX_MESSAGESIGNER_H
7 #define PIVX_MESSAGESIGNER_H
31 static bool SignMessage(
const std::string& strMessage, std::vector<unsigned char>& vchSigRet,
const CKey& key);
33 static bool SignMessage(
const std::string& strMessage, std::vector<unsigned char>& vchSigRet,
const CBLSSecretKey& key);
35 static bool VerifyMessage(
const CPubKey& pubkey,
const std::vector<unsigned char>& vchSig,
const std::string& strMessage, std::string& strErrorRet);
37 static bool VerifyMessage(
const CKeyID& keyID,
const std::vector<unsigned char>& vchSig,
const std::string& strMessage, std::string& strErrorRet);
48 static bool SignHash(
const uint256& hash,
const CKey& key, std::vector<unsigned char>& vchSigRet);
52 static bool VerifyHash(
const uint256& hash,
const CPubKey& pubkey,
const std::vector<unsigned char>& vchSig, std::string& strErrorRet);
54 static bool VerifyHash(
const uint256& hash,
const CKeyID& keyID,
const std::vector<unsigned char>& vchSig, std::string& strErrorRet);
78 bool Sign(
const std::string strSignKey);
Helper class for signing hashes and checking their signatures.
static bool SignHash(const uint256 &hash, const CKey &key, std::vector< unsigned char > &vchSigRet)
Sign the hash, returns true if successful.
static bool VerifyHash(const uint256 &hash, const CPubKey &pubkey, const std::vector< unsigned char > &vchSig, std::string &strErrorRet)
Verify the hash signature, returns true if successful.
An encapsulated private key.
A reference to a CKey: the Hash160 of its serialized public key.
Helper class for signing messages and checking their signatures.
static bool SignMessage(const std::string &strMessage, std::vector< unsigned char > &vchSigRet, const CKey &key)
Sign the message, returns true if successful.
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.
static bool GetKeysFromSecret(const std::string &strSecret, CKey &keyRet, CPubKey &pubkeyRet)
Set the private/public key values, returns true if successful.
static uint256 GetMessageHash(const std::string &strMessage)
Get the hash based on the input message.
An encapsulated public key.
Base Class for all signed messages on the network.
bool Sign(const CKey &key, const CKeyID &keyID)
CSignedMessage Class Functions inherited by network signed-messages.
bool CheckSignature(const CKeyID &keyID) const
virtual std::string GetStrMessage() const =0
std::vector< unsigned char > GetVchSig() const
virtual ~CSignedMessage()
virtual uint256 GetSignatureHash() const =0
std::string GetSignatureBase64() const
std::vector< unsigned char > vchSig
void SetVchSig(const std::vector< unsigned char > &vchSigIn)