| 55 | } |
| 56 | |
| 57 | bool MessageSign( |
| 58 | const CKey& privkey, |
| 59 | const std::string& message, |
| 60 | std::string& signature) |
| 61 | { |
| 62 | std::vector<unsigned char> signature_bytes; |
| 63 | |
| 64 | if (!privkey.SignCompact(MessageHash(message), signature_bytes)) { |
| 65 | return false; |
| 66 | } |
| 67 | |
| 68 | signature = EncodeBase64(signature_bytes); |
| 69 | |
| 70 | return true; |
| 71 | } |
| 72 | |
| 73 | uint256 MessageHash(const std::string& message) |
| 74 | { |