Converts a hex string to a public key if possible
| 11 | |
| 12 | // Converts a hex string to a public key if possible |
| 13 | CPubKey HexToPubKey(const std::string& hex_in) |
| 14 | { |
| 15 | if (!IsHex(hex_in)) { |
| 16 | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid public key: " + hex_in); |
| 17 | } |
| 18 | CPubKey vchPubKey(ParseHex(hex_in)); |
| 19 | if (!vchPubKey.IsFullyValid()) { |
| 20 | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid public key: " + hex_in); |
| 21 | } |
| 22 | return vchPubKey; |
| 23 | } |
| 24 | |
| 25 | // Retrieves a public key for an address from the given CKeyStore |
| 26 | CPubKey AddrToPubKey(CKeyStore* const keystore, const std::string& addr_in) |
no test coverage detected