Ejemplo n.º 1
0
 public static Signature SignRFC6979(this ECDsa key, IMessage message)
 {
     return(new Signature
     {
         Key = ByteString.CopyFrom(key.PublicKey()),
         Sign = ByteString.CopyFrom(key.SignRFC6979(message.ToByteArray())),
     });
 }
Ejemplo n.º 2
0
 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())),
     };
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public static OwnerID ToOwnerID(this ECDsa key)
 {
     return(key.PublicKey().PublicKeyToOwnerID());
 }
Ejemplo n.º 5
0
 public static string ToAddress(this ECDsa key)
 {
     return(key.PublicKey().PublicKeyToAddress());
 }