JSON Web Signature (JOSE.JWS) under Lazarus / FreePascal - algorithm

Is there a way to sign a JSON UTF8String with JOSE.JWS before sending via https to a (government) server using Lazarus / FPC ?
The specification is heavy and writing everything from scratch seems to be an impossible big job before (government's) deadline.
(Although I've found a Delphi XE7+ code here... , sadly it is using outdated Indy components, so would be hard to rewrite to FPC + Synapse)
So the best would be to do that with latest (trunc) Ararat Synapse component, because it can handle OpenSSL3+ too.
(And the REST communication is working with that already.)
OR
Maybe possible to use a freely available, compiled binary (Win7 compatible 32-bit .DLL file) from somewhere and write a wrapper around it?

Related

can we integrate a processing gui with moodle?

i made a gui recently where the goal was to view the results of some actions there , so mostly it was like a simulation game that has no connection with any hardware , i proposed this for my school that uses moodle and i want to know if there is a way to integrate it there , the gui i used has controlP5 library and videos and gif libraries as well, i would appreciate the help
from my researches so far i found that we can integrate processing code with html after some modifications , but didn't find anything for moodle yet
My understanding is that Processing in java mode, using controlP5, etc. will work on a client machine, not on a server (like moodle) (not easily at least).
Regarding embedding a processing sketch a web page:
java applet support is deprecated (can no longer embed a .jar applet)
processing.js is deprecated (and controlP5 wouldn't be compatible anyway)
you can however port your code to p5.js
I don't know enough moodle, but perhaps you can embed a JS snippet/iframe/etc on a moodle page.
Regarding controlP5, in p5.js, you can look at p5.dom.js functionalities such as createSlider(), createButton(), etc. or use libraries like p5.gui or p5.touchgui.

How to generate executable across platforms

in case i have a source code and an api to generate windows executable version, is there any possibility or any easy approach to convert it into something that can be executed across Linux /mac or Solaris platforms?
If your code is in a .NET language, there are online and offline translators that can convert the code to Java.
This is just language translation, and doesn't convert the API calls, but it would be a first step in the process.
Another way to handle the problem would be to choose a cloud-based web service or bridge solution. If you have a significant amount of program logic, exposing APIs in this way would allow you to maintain much of the code in its existing language, while making it invocable on other platforms.

Programming language without additional requirements

Soon I will be coding the file patcher for my application (check if the files are up-to-date and download newest if not) so its not much to code.
The problem is that I don't want the application users to be forced to use additional libraries like .NET (even though I like to code in vb.net or C#). I keep in mind that the .NET framework is installing together with the Windows but still there are plenty people who somehow doesn't have this framework installed, and thats why I'm looking for the programming language that wont require an additional libraries to run the application.
I haven't got much knowledge about programming in C++/Java but I have some experience with the AutoIT, vb.net, C#.
So the question is, what programming language will be the best for this purpose?
This answer is for "what language is available on any version of Windows without additional requirements". There are many other options for "what I can use to create application that can be xcopy deployed on any version of Windows".
JavaScript is probably your best bet - it is supported on most recent versions of Windows (according to Wikipedia article - Windows Script Host JavaScript available for scripting starting with Windows 98). Allows basic operation with files and HTTP communication - maybe enough for simple patching application.
Next would be native Win32 application, but lack of C++ experience will make it hard.
Freepascal, D and Go — to name a few — are much easier to program than C++ and could be told to produce statically-compiled binaries (not dependent on anything but certain system DLLs).
I, personally, would use the latter as it has all the necessary tools (including HTTP and binary I/O) in its standard library and is super-easy to get started with.

Winsock LSP vs API hooking

I need your advices what to use - Layered Service Provider or just load mine DLL in all
process and hook necessary functions using, NCodeHook or EasyHook library.
This is needed for inspection of HTTP traffic.
P.S. This need to be done for commercial application
Thanks!
Before making a decision you need to consider the following:
Code hooking:
AV doesn't like code hooking, if you're using a library that has external DLLs, run a check with AV total before committing to it.
Make sure the library's license works for you, for example, for LGPL you won't be able to embed the library as static without becoming GPL yourself.
I heard people managed to hook Metro apps, it's something to investigate.
If you have another code hooking app, it may conflict.
LSP:
The default MS sample/installer is broken.
You may get something working on a VM or fresh install, but to get LSP working properly across all OS and browsers, will take 6-12 months.
Will not work with Metro apps.
In Komodia we use a combo of LSP/WFP for our SDK, knowing what I know now, if I'd go back 4 years, I'd use LSP all over again.
Good luck.
Using Easyhook will be a nice way to do it check the following http://www.sghaida.com/easyhook-for-systemcall-hooking/

Is it possible to create an application WITHOUT a framework?

I was just thinking. C# has Winforms/WPF, Java has Swing and other frameworks, C++ has QT and so on; is it possible to create an application without using a Framework?
Putting aside the practicality of it, I'm just curious. How would one create an application that Just Works(tm) without needing external frameworks?
Two options come to mind:
Classical Win32 applications written in C. I don't know if standard Windows SDK API also counts as an "external framework" in your book, but that's as low as it gets.
DirectX/OpenGL games written from scratch with your own homebrew framework (not external, right?) There you get to do all the drawing yourself - although again, you use a pretty big library of primitive drawing functions.
If you want even less "framework", you'll have to code your own OS and drivers. :P
C# needs .NET Framework, not WinForms (which is an optional library used by some application). The same with Java.
Unmanaged (native) applications usually use some runtime library - the library of common functions. You can write a native application without any library - the compiler lets you do this, but you will need to (re)write lots of common functions, eg. for string manipulation etc..
Firstly, what is a framework?
Really a framework is just a bunch of code that is provided to you. You could, at least in theory, write the same code yourself. In that case you wouldn't be using a framework.
Your application can only do what the operating system allows it to do. Your program cannot directly manipulate the graphics card for example. So you have to use the APIs of your operating system in order to do anything.
So you are going to be calling into other code. (unless you write your own operating system). You will also being using another framework or api to get stuff done.
Yes. How: in the way that the frameworks you mentioned are implemented.
From a Windows point of view, you would register your window with Windows, then listen to window messages and react as required. Everything would be up to you - from drawing the window to building controls.

Resources