Dash Core  0.12.2.1
P2P Digital Currency
messagesigner.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2017 The Dash Core developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef MESSAGESIGNER_H
6 #define MESSAGESIGNER_H
7 
8 #include "key.h"
9 
13 {
14 public:
16  static bool GetKeysFromSecret(const std::string strSecret, CKey& keyRet, CPubKey& pubkeyRet);
18  static bool SignMessage(const std::string strMessage, std::vector<unsigned char>& vchSigRet, const CKey key);
20  static bool VerifyMessage(const CPubKey pubkey, const std::vector<unsigned char>& vchSig, const std::string strMessage, std::string& strErrorRet);
21 };
22 
26 {
27 public:
29  static bool SignHash(const uint256& hash, const CKey key, std::vector<unsigned char>& vchSigRet);
31  static bool VerifyHash(const uint256& hash, const CPubKey pubkey, const std::vector<unsigned char>& vchSig, std::string& strErrorRet);
32 };
33 
34 #endif
static bool GetKeysFromSecret(const std::string strSecret, CKey &keyRet, CPubKey &pubkeyRet)
Set the private/public key values, 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 succcessful.
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 succcessful.
Definition: pubkey.h:37
static bool SignMessage(const std::string strMessage, std::vector< unsigned char > &vchSigRet, const CKey key)
Sign the message, returns true if successful.
Definition: key.h:35