6 namespace org { namespace ldk { namespace structs {
10 * A set of keys that were HKDF-expanded from an initial call to
11 * [`KeysInterface::get_inbound_payment_key_material`].
13 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
15 public class ExpandedKey : CommonBase {
16 internal ExpandedKey(object _dummy, long ptr) : base(ptr) { }
18 if (ptr != 0) { bindings.ExpandedKey_free(ptr); }
22 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
24 * It is recommended to cache this value and not regenerate it for each new inbound payment.
26 public static ExpandedKey of(byte[] key_material) {
27 long ret = bindings.ExpandedKey_new(InternalUtils.check_arr_len(key_material, 32));
28 GC.KeepAlive(key_material);
29 if (ret >= 0 && ret <= 4096) { return null; }
30 org.ldk.structs.ExpandedKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpandedKey(null, ret); }
31 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };