public static Signature SignRFC6979(this ECDsa key, IMessage message) { return(new Signature { Key = ByteString.CopyFrom(key.PublicKey()), Sign = ByteString.CopyFrom(key.SignRFC6979(message.ToByteArray())), }); }
public static void SignControlMessage(this ECDsa key, IControlMessage message) { message.Signature = new() { Key = ByteString.CopyFrom(key.PublicKey()), Sign = ByteString.CopyFrom(key.SignData(message.SignData.ToByteArray())), }; }
public static Signature SignMessagePart(this IMessage data, ECDsa key) { var data2sign = data is null?Array.Empty <byte>() : data.ToByteArray(); var sig = new Signature { Key = ByteString.CopyFrom(key.PublicKey()), Sign = ByteString.CopyFrom(data2sign.SignData(key)), }; return(sig); }
public static OwnerID ToOwnerID(this ECDsa key) { return(key.PublicKey().PublicKeyToOwnerID()); }
public static string ToAddress(this ECDsa key) { return(key.PublicKey().PublicKeyToAddress()); }