bool RippleAddress::isValid() const { bool bValid = false; if (!vchData.empty()) { CKey key; switch (nVersion) { case VER_NODE_PUBLIC: bValid = key.SetPubKey(getNodePublic()); break; case VER_ACCOUNT_PUBLIC: bValid = key.SetPubKey(getAccountPublic()); break; case VER_ACCOUNT_PRIVATE: bValid = key.SetPrivateKeyU(getAccountPrivate()); break; default: bValid = true; break; } } return bValid; }
bool RippleAddress::verifyNodePublic (uint256 const& hash, Blob const& vchSig) const { CKey pubkey = CKey (); bool bVerified; if (!pubkey.SetPubKey (getNodePublic ())) { // Failed to set public key. bVerified = false; } else { bVerified = pubkey.Verify (hash, vchSig); } return bVerified; }
bool RippleAddress::verifyNodePublic(const uint256& hash, const std::vector<unsigned char>& vchSig) const { CKey pubkey = CKey(); bool bVerified; if (!pubkey.SetPubKey(getNodePublic())) { // Failed to set public key. bVerified = false; } else { bVerified = pubkey.Verify(hash, vchSig); } return bVerified; }
bool RippleAddress::verifyNodePublic (uint256 const& hash, Blob const& vchSig, ECDSA fullyCanonical) const { CKey pubkey = CKey (); bool bVerified; bVerified = isCanonicalECDSASig (vchSig, fullyCanonical); if (bVerified && !pubkey.SetPubKey (getNodePublic ())) { // Failed to set public key. bVerified = false; } else { bVerified = pubkey.Verify (hash, vchSig); } return bVerified; }