Beispiel #1
0
        public async Task Handle(IntPtr ctx)
        {
            IntPtr signCtx = create_sign_ctx(ctx);

            bytes_t message = in3_sign_ctx_get_message(signCtx);
            bytes_t account = in3_sign_ctx_get_account(signCtx);

            byte[] accountBytes = new byte[account.len];
            Marshal.Copy(account.data, accountBytes, 0, (int)account.len);
            string accountStr = DataTypeConverter.BytesToHexString(accountBytes, (int)account.len);

            byte[] messageBytes = new byte[message.len];
            Marshal.Copy(message.data, messageBytes, 0, (int)message.len);
            string messageStr = DataTypeConverter.BytesToHexString(messageBytes, (int)message.len);

            string signedData = await _wrapper.Client.Signer.Sign(messageStr, accountStr);

            in3_sign_ctx_set_signature_hex(signCtx, signedData);
            in3_sign_ctx_set_signature(ctx, signCtx);
            Utils._free_(signCtx);
        }