Saurik created ldid, which is meant for code-signing on linux. It may be useful to checkout this article about Developing without a Provisioning Profile and also this project which I believe is an ldid implementation.
If you have used the Adobe code signing utility before then you might have noticed that it is a bit flaky. I have had issues with it numerous times.
The truth is that it will be very hard to create a code-signing tool and even if you spent a ton of time on it and eventually got an implementation working, Apple could change any little piece of the code signing process that could end up breaking your entire system. It is better to rely on the tools that Apple has provided developers to do code signing. If I could make a suggestion it would be to NOT try to do this.