[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / ExpandedKey.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * A set of keys that were HKDF-expanded from an initial call to
11  * [`NodeSigner::get_inbound_payment_key_material`].
12  * 
13  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
14  */
15 public class ExpandedKey : CommonBase {
16         internal ExpandedKey(object _dummy, long ptr) : base(ptr) { }
17         ~ExpandedKey() {
18                 if (ptr != 0) { bindings.ExpandedKey_free(ptr); }
19         }
20
21         /**
22          * Create a  new [`ExpandedKey`] for generating an inbound payment hash and secret.
23          * 
24          * It is recommended to cache this value and not regenerate it for each new inbound payment.
25          */
26         public static ExpandedKey of(byte[] key_material) {
27                 long ret = bindings.ExpandedKey_new(InternalUtils.encodeUint8Array(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); };
32                 return ret_hu_conv;
33         }
34
35 }
36 } } }