 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
17 if(!vchSecret.
SetString(strSecret))
return false;
19 keyRet = vchSecret.
GetKey();
62 strErrorRet =
"Error recovering public key.";
66 if(pubkeyFromSig.
GetID() != keyID) {
67 strErrorRet =
strprintf(
"Keys don't match: pubkey=%s, pubkeyFromSig=%s, hash=%s, vchSig=%s",
A reference to a CKey: the Hash160 of its serialized public key.
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.
A base58-encoded secret key.
static bool SignMessage(const std::string &strMessage, std::vector< unsigned char > &vchSigRet, const CKey &key)
Sign the message, 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.
bool SignCompact(const uint256 &hash, std::vector< unsigned char > &vchSig) const
Create a compact signature (65 bytes), which allows reconstructing the used public key.
bool SetString(const char *pszSecret)
256-bit unsigned big integer.
CPubKey GetPubKey() const
Compute the public key from a private key.
bool RecoverCompact(const uint256 &hash, const std::vector< unsigned char > &vchSig)
Recover a public key from a compact signature.
std::string EncodeBase64(const unsigned char *pch, size_t len)
static bool GetKeysFromSecret(const std::string &strSecret, CKey &keyRet, CPubKey &pubkeyRet)
Set the private/public key values, returns true if successful.
An encapsulated public key.
An encapsulated private key.
A writer stream (for serialization) that computes a 256-bit hash.
const std::string strMessageMagic
static bool SignHash(const uint256 &hash, const CKey &key, std::vector< unsigned char > &vchSigRet)
Sign the hash, returns true if successful.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
std::string ToString() const