How can I generate proper RSA keyfiles with correct syntax? Best would be solution in javascript.

I have already generated numbers for 512bit key:

e = 00065537

d = 2a3ff2f501835d7d0f7ccad34265525b0c91f800fc252324e4bb5668392ba55a65d812d658b7065725c259a12115918dbdbb ea6cead9225a91c3fcc6b43f1cb3

m = 4bb26cf2e1e1cdbbf78f89a60d5af5cf094a7216f9fe2d0e2288dc14e6005e0b6de46dc38f0e92b8b3281e9f1cf87257fb54 bff579907e8a3c114133b74cb815