| 48 | } |
| 49 | |
| 50 | bool pubkey_from_hexstr(const char *derstr, size_t slen, struct pubkey *key) |
| 51 | { |
| 52 | size_t dlen; |
| 53 | unsigned char der[PUBKEY_CMPR_LEN]; |
| 54 | |
| 55 | dlen = hex_data_size(slen); |
| 56 | if (dlen != sizeof(der)) |
| 57 | return false; |
| 58 | |
| 59 | if (!hex_decode(derstr, slen, der, dlen)) |
| 60 | return false; |
| 61 | |
| 62 | return pubkey_from_der(der, dlen, key); |
| 63 | } |
| 64 | |
| 65 | char *pubkey_to_hexstr(const tal_t *ctx, const struct pubkey *key) |
| 66 | { |