Is it Xades?
I've done Xades signing, but not with RSA algorithms. Still, might be useful for you. Drop me your GitHub username if you need the code.
To add Xades support I used a reference implementation in .Net - read the Xades docs on how it's supposed to work, then decompiled .Net libraries to see how it all actually works, and recreated it in ObjectScript.