Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

messagesigner.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2019 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);
22  static bool VerifyMessage(const CKeyID& keyID, const std::vector<unsigned char>& vchSig, const std::string& strMessage, std::string& strErrorRet);
23 };
24 
28 {
29 public:
31  static bool SignHash(const uint256& hash, const CKey& key, std::vector<unsigned char>& vchSigRet);
33  static bool VerifyHash(const uint256& hash, const CPubKey& pubkey, const std::vector<unsigned char>& vchSig, std::string& strErrorRet);
35  static bool VerifyHash(const uint256& hash, const CKeyID& keyID, const std::vector<unsigned char>& vchSig, std::string& strErrorRet);
36 };
37 
38 #endif
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.
static bool SignHash(const uint256 &hash, const CKey &key, std::vector< unsigned char > &vchSigRet)
Sign the hash, returns true if successful.
Helper class for signing messages and checking their signatures.
Definition: messagesigner.h:12
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.
Helper class for signing hashes and checking their signatures.
Definition: messagesigner.h:27
static bool SignMessage(const std::string &strMessage, std::vector< unsigned char > &vchSigRet, const CKey &key)
Sign the message, returns true if successful.
An encapsulated public key.
Definition: pubkey.h:30
256-bit opaque blob.
Definition: uint256.h:123
static bool GetKeysFromSecret(const std::string &strSecret, CKey &keyRet, CPubKey &pubkeyRet)
Set the private/public key values, returns true if successful.
A reference to a CKey: the Hash160 of its serialized public key.
Definition: pubkey.h:20
An encapsulated private key.
Definition: key.h:27
Released under the MIT license