예제 #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())),
     });
 }
예제 #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())),
     };
 }
예제 #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);
        }
예제 #4
0
 public static OwnerID ToOwnerID(this ECDsa key)
 {
     return(key.PublicKey().PublicKeyToOwnerID());
 }
예제 #5
0
 public static string ToAddress(this ECDsa key)
 {
     return(key.PublicKey().PublicKeyToAddress());
 }