2017-01-10 15:38:33 +10:30
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_HSM_CONTROL_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_HSM_CONTROL_H
|
|
|
|
#include "config.h"
|
2017-06-24 16:20:23 +09:30
|
|
|
#include <ccan/short_types/short_types.h>
|
2017-01-10 15:38:33 +10:30
|
|
|
|
|
|
|
struct lightningd;
|
2019-04-08 19:28:32 +09:30
|
|
|
struct node_id;
|
2020-05-26 16:06:13 -05:00
|
|
|
struct ext_key;
|
2018-07-09 20:47:59 +09:30
|
|
|
|
|
|
|
/* Ask HSM for a new fd for a subdaemon to use. */
|
|
|
|
int hsm_get_client_fd(struct lightningd *ld,
|
2019-04-08 19:28:32 +09:30
|
|
|
const struct node_id *id,
|
2018-07-09 20:47:59 +09:30
|
|
|
u64 dbid,
|
2023-08-07 15:21:40 +09:30
|
|
|
u64 permissions);
|
2017-01-10 15:38:33 +10:30
|
|
|
|
2018-09-20 12:37:41 +09:30
|
|
|
/* Ask HSM for an fd for a global subdaemon to use (gossipd, connectd) */
|
2023-08-07 15:21:40 +09:30
|
|
|
int hsm_get_global_fd(struct lightningd *ld, u64 permissions);
|
2018-09-20 12:37:41 +09:30
|
|
|
|
2023-03-21 14:28:09 +10:30
|
|
|
/* Is this capability supported by the HSM? (So far, always a message
|
|
|
|
* number) */
|
|
|
|
bool hsm_capable(struct lightningd *ld, u32 msgtype);
|
|
|
|
|
2020-05-26 16:06:13 -05:00
|
|
|
struct ext_key *hsm_init(struct lightningd *ld);
|
2023-03-21 14:28:15 +10:30
|
|
|
|
2023-04-10 09:42:56 +09:30
|
|
|
/* Send request to hsmd, get response. */
|
|
|
|
const u8 *hsm_sync_req(const tal_t *ctx,
|
|
|
|
struct lightningd *ld,
|
|
|
|
const u8 *msg TAKES);
|
|
|
|
|
2023-03-21 14:28:15 +10:30
|
|
|
/* Get (and check!) a bip32 derived pubkey */
|
|
|
|
void bip32_pubkey(struct lightningd *ld, struct pubkey *pubkey, u32 index);
|
|
|
|
|
2017-01-10 15:38:33 +10:30
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_HSM_CONTROL_H */
|